ITeye博客

RichFaces按回车键提交表单

stenlylee · 2009-12-21 11:28 · RichFaces · 企业架构 · richfaces · Bean · Markdown

<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)

  1. #1 楼 · tmj_159 · 2010-05-18 10:58

    谢谢,帮了我大忙了

评论功能维护中,当前仅展示历史评论。