如何修复需要在JSF页面内单击两次?

问题描述 投票:0回答:1

我在JSF页面中有一个JSF。而<h:form>是主要的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“user gestion.xhtml”内部的按钮时,需要2次点击才能获得操作。

我已经尝试添加<f:ajax render=":form" />来解决问题,但没有工作。

我该如何解决这个问题?

jsf primefaces
1个回答
0
投票

这是JSF,JAVASERVERFACES_SPEC_PUBLIC-790的一个错误,将在版本2.3中修复。 (感谢BalusC纠正我的帖子。)

您可以使用this script来解决问题。

这是一个good answer about the invokation of commandLink and commandButton。我还建议你相应地设计你的页面。

但是,PrimeFaces解决方案对我有用。它是有效的,如果你给按钮表格将​​继续,并将在ajax请求后呈现。

    <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>
© www.soinside.com 2019 - 2024. All rights reserved.