How to execute an ADF button's action method using javascript
http://hazem-adf-tips.blogspot.com/2012/07/how-to-execute-adf-buttons-action.html
Suppose that we have UI input components that, when the Enter key is pressed, will virtually press a button within a page or page fragment.
Let's assume a page fragment containing an input text component and a command button to press:
<af:panelFormLayout id="pfl1">
<f:facet name="footer">
<af:commandButton text="save" id="cb1" action="#{testBean.buttonAction}"
clientComponent="true"/>
</f:facet>
<af:inputText label="Label 1" id="it1" value="#{testBean.param1}" autoSubmit="true">
<af:clientListener method="executeButtonMethod" type="keyUp"/>
</af:inputText>
</af:panelFormLayout>
The command button is bound to a managed bean action method. By default, the action method is invoked when users press the command button. However, with the JavaScript shown next, this can be simulated and mapped to the Enter key
press in the text field.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="/JSP/Page" version="2.1"
xmlns:af=/adf/faces/rich
xmlns:f="/jsf/core">
<af:resource type="javaScript">
function executeButtonMethod (event){
if (event.getKeyCode() == AdfKeyStroke.ENTER_KEY) {
var inputTextField = event.getSource();
var button = inputTextField.findComponent('cb1');
var partialSubmit = true;
AdfActionEvent.queue(button, partialSubmit); event.cancel();
}
}
</af:resource>
For JavaScript to work, note the use of the af:clientListener on the input text field and the use of the clientComponent="true" configuration on the button.
分享到:
相关推荐
ArcGIS API 包括: ADF API;Javascript API;Flex API;Server SOAP API
在ADF工程中使用javascript,我也是从官网上找的一个示例,大家可以参考一下
包含 ADF 重定向页面 换界面皮肤方法
ADF4351配置程序,主要是C51配置ADF5351/4350
Oracle ADF 11g回车键执行Action JS
ADF Execl导入导出方法
ADF4351锁相环例程,能输出35M~4400M的信号
ADF4351寄存器配置软件,可适用于ADF435x系列
英文版的,中文版还在找。貌似中文的ADF设计网上都是付费购买的。。。。
ADF应用开发,中文资料,适合英文不好的同学
基于80c51f芯片控制的频率合成器adf4360-7
ADI公司ADF4360-9 PLL+VCO频综芯片调试笔记
使用Verilog对ADF4355进行初始化配置
资源包括三个文件,GPSTRACK.js实现了GPS位置的实时显示,其中引用了另外两个文件,分别是jquery.js和hashtable.js
电赛时准备的锁相环历程,支持103和407,可以通过调用函数更改输出频率。
这个芯片是一个很好的信号发生器的应用,频率范围宽,外围电路少,体积小等优点,但使用起来技术难度也比较大,因为带宽比较宽,外围电路处理不好相噪就很差,还有就是采用分频,倍频处理方式,多次谐波也比较多。
ADF4351结合外部环路滤波器和外部参考频率使用时,可实现小数 N分频或整数 N分频锁相环 (PLL)频率合成器。
此代码可用于adf检验(This code can be used for ADF verification)
在MATLAB中检验数据的单位根,关于单位根检测的matlab代码
ArcGIS API for Javascript 开发教程 webapp builder协同ADF Firebug 和 aptana studio3