a4j:commandLink executes action after double clicking

时间秒杀一切 提交于 2019-12-04 15:32:23

In the other form wherein you're updating the shown form with the table, make sure that you include the client ID of the form in the ajax render. Otherwise the updated form will lose its view state and thus nothing will be processed on 1st submit. After the 1st submit the form get its view state back and subsequent submits will be processed successfully.

E.g.

<h:form>
  ...
    <h:commandButton value="Submit" action="#{bean.submit}">
        <f:ajax execute="@form" render=":otherPanel :otherForm" />
    </h:commandButton>
</h:form>

<h:panelGroup id="otherPanel">
    ...
    <h:form id="otherForm">
        ...
    </h:form>
    ...
</h:panelGroup>

This problem is related to JSF spec issue 790 and is fixed for the upcoming JSF 2.2. PrimeFaces 3.x doesn't have this problem as its modified JSF ajax engine has already taken this into account.

See also:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!