`
stenlylee
  • 浏览: 255441 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

RichFaces按回车键提交表单

阅读更多
<h:inputText value="#{bean.text}"/>
<a4j:commandButton value="Submit"/>
...
<rich:hotKey key="return" handler="#{rich:element('button')}.click()"/>

 

如果想要当焦点放到输入域里面的时候提交,下面的代码可做参考

 

<h:inputText id="input" value="#{bean.text}"/>
<a4j:commandButton id="button" value="Submit"/>
...
<rich:hotKey key="return" 
       selector="#input"     
       handler="#{rich:element('button')}.click()"/>

 

分享到:
评论
1 楼 tmj_159 2010-05-18  
谢谢,帮了我大忙了

相关推荐

Global site tag (gtag.js) - Google Analytics