我想在按Enter键时执行按钮,但不知何故不起作用:
<f:view>
<h:body>
<h1>#{bv.title}</h1>
<h2>#{bv.version}</h2>
<h:panelGrid columns="2">
<h:form id="searchForm">
......
<f:facet name="footer">
<h:panelGroup style="display:block; text-align:left">
<h:commandButton style="font-size: large;" id="create" value="#{bv.buttonCreate}" action="#{search.create}" />
<h:commandButton style="font-size: large;" id="clear" value="#{bv.buttonReset}" action="#{search.clear}" immediate="true" /><br/>
<h:commandButton style="font-size: large;" id="pdf" rendered="#{search.jpgRendered}" immediate="true" action="#{search.openPDF}" value="Drucken als PDF" />
<rich:hotKey key="return"
selector="#searchForm"
handler="#{rich:element('searchForm:create')}.click();
event.stopPropagation();event.preventDefault();
return false;"/>
</h:panelGroup>
</f:facet>
知道为什么这不起作用?
THX!