我需要让我的primefaces
p:commandLink
在用户按下enter
键时提交h:form
。使用primefaces小部件输入表单
我尝试了解决方案建议here和其他几个地方。我也试过primefaces
defaultCommand
。无论我尝试什么,浏览器似乎都注意到按钮按下了,但action
未执行。
这些都是我的表单控件:
<p:autoComplete id="acSimple" value="#{home.searchKeywords}" completeMethod="#{home.completeText}" style="" />
<p:commandLink id="srchbutton" action="#{home.goToSearchResults}" onclick=" $('.prgrs').show();">
<h:graphicImage id="srch" name="images/searchbutton.jpg" class="img-responsive" style="display: inline-block; margin-left:0px; margin-bottom:-0px;" />
</p:commandLink>
<p:defaultCommand target="srchbutton" />
定义'没有运气',更明确什么不工作和调试,所以你得到为什么 – Kukeltje
没有运气意味着表单没有提交。浏览器似乎注意到按钮按下,但操作未执行。我也在编辑这个问题来反映这一点。 – Eddy
'onclick'是否被解雇? – QueryLars