Saleforce之actionFunction和setTimeout 定时调用
来源:互联网 发布:四川大学网络本科 编辑:程序博客网 时间:2024/05/18 11:48
ViualForce
<apex:page controller="exampleCon"><script type="text/javascript">var myVar;function myFunction() { myVar = setTimeout(alertFunc, 3000); methodOneInJavascript('no');}function alertFunc() { //alert("Hello!"); myFunction();}</script> <apex:form > <!-- Define the JavaScript function sayHello--> <apex:actionFunction name="sayHello" action="{!sayHello}" rerender="out" status="myStatus"/> </apex:form> <apex:outputPanel id="out"> <apex:outputText value="Hello "/> <apex:actionStatus startText="requesting..." id="myStatus"> <apex:facet name="stop">{!username}</apex:facet> </apex:actionStatus> </apex:outputPanel> <!-- Call the sayHello JavaScript function using a script element--> <script>window.setTimeout(sayHello,2000)</script> <p><apex:outputText value="Clicked? {!state}" id="showstate" /></p> <!-- Add the onclick event listener to a panel. When clicked, the panel triggers the methodOneInJavascript actionFunction with a param --> <apex:outputPanel onclick="methodOneInJavascript('Yes!')" styleClass="btn" > Click Me </apex:outputPanel> <apex:form > <apex:commandButton > <apex:commandButton action="{!methodOne}" value="+" id="pulsButton" style="width:40px; font-weight:bold" onComplete="return myFunction();"/> </apex:commandButton> <apex:actionFunction action="{!methodOne}" name="methodOneInJavascript" rerender="showstate"> <apex:param name="firstParam" assignTo="{!state}" value="" /> </apex:actionFunction> </apex:form></apex:page>
public with sharing class exampleCon { String uname; public String getUsername() { return uname; } public PageReference sayHello() { uname = UserInfo.getName(); return null; } public void setState(String n) { state = n; } public String getState() { return state; } public PageReference methodOne() { string par = ApexPages.currentPage().getParameters().get('firstParam'); state = par + 'ctrl'; return null; } private String state = 'no';}
Visualforce Pageにapex:paramタグの使用方法まとめ
https://www.xgeek.net/ja/salesforce/the-usage-of-apexparam-in-visualforce-page/ 0 0
- Saleforce之actionFunction和setTimeout 定时调用
- saleforce中ActionFunction和SupportFunction的区别
- JavaScript定时调用函数(SetInterval与setTimeout)
- setTimeout()间歇调用和 setInterval()超时调用
- 超时调用setTimeout 和 间歇调用setInterval
- javaScript中的setTimeout用于定时调用某个方法
- for循环里面的方法用setTimeOut定时调用
- javascript之setTimeout和setInterval
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用
- setTimeout()和setInterval() 何时被调用执行
- setTimeout()和setInterval() 何时被调用执行
- Jquery实现定时执行操作setInterval和clearInterval、setTimeout函数
- Jquery定时执行器setInterval和setTimeout的使用
- Mini Parser
- hdu 5558 Alice's Classified Message(后缀数组)
- gcc compile :conflicting types for ‘do_client’
- Gradle相关
- 菜鸟练习华为级考题——字符串过滤和统计高频数字出现频次
- Saleforce之actionFunction和setTimeout 定时调用
- 使用springfox整合SpringMVC和Swagger
- 【JZOJ4793】【GDOI2017模拟9.21】妮厨的愤怒
- Android.mk详解
- 七种css方式让一个容器水平垂直居中
- Json字符串处理
- 以爬虫工程师身份谈谈Android端的信息安全
- 操作系统常见面试题
- Node.js VM模块