问题描述
我在JSF页面中有一个JSF. <h:form>
在主体JSF中.
i have a JSF inside a JSF page. and the <h:form>
is in the principal JSF .
<p:tabView id="tabView">
<p:tab id="tab1" title="Gestion des Utilisateur" titleStyle="titre">
<ui:include src="/admin/usergestion.xhtml" />
</p:tab>
</p:tabView>
因此,当我单击对集成的JSF"usergestion.xhtml"进行安装的按钮时,只需单击两次即可完成操作.
so when i click in the button thats insise the integrated JSF "usergestion.xhtml" it need 2 clicks to get the action .
我已经尝试添加<f:ajax render=":form" />
解决问题,但没有成功.
i already tryed to add <f:ajax render=":form" />
to fixe the problem but didnt work .
我该如何解决这个问题?
how can i fixe this problem ?
推荐答案
这是JSF的错误, JAVASERVERFACES_SPEC_PUBLIC-790 ,并将在2.3版中修复. (感谢BalusC纠正了我的帖子.)
It is a bug of JSF,JAVASERVERFACES_SPEC_PUBLIC-790 , and will be fixed in version 2.3. (thanks to BalusC for correcting my post.)
您可以使用此脚本来解决该问题.
You can use this script to solve the issue.
以下是有关commandLink和commandButton调用的很好的答案.我还建议您相应地设计页面.
Here is a good answer about the invokation of commandLink and commandButton. I also suggest you to design your page accordingly.
但是,有适用于我的PrimeFaces解决方案.如果您提供该按钮,它将继续进行表单,并在ajax请求后呈现该按钮,那么它将起作用.
However, there is a PrimeFaces solution which works for me. It works if you give the button which form will be proceed and which will be rendered after ajax request.
<h:form id="page1">
<p:commandButton value="" action="#{some_action}">
<f:ajax execute="@form" render=":page2" />
</p:commandButton>
</h:form>
您的操作返回到第2页
<h:form id="page2">
Some Components
</h:form>
这篇关于如何修复两次需要在JSF页面中单击的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!