Jsf p:commandLink在呈现ajax时不起作用
我正在尝试构建一个ajax表单。Im使用名为“pageMode”的bean变量来保存表单的状态(开始、确认等)。根据pageMode的值,我的jsf页面呈现或不呈现一些按钮。(启动时,仅显示提交按钮,提交后显示确认按钮…) 这是我的问题 当我第一次访问页面时,Submit按钮工作正常,但在我Submit之后Confirm按钮不能正常工作(不触发bean方法),这意味着pageMode=Confirm 我试图用h:pannelGrid包装我的按钮,并将rendred属性添加到按钮上。。没有工作:( xhtml看起来像这样Jsf p:commandLink在呈现ajax时不起作用,jsf,primefaces,Jsf,Primefaces,我正在尝试构建一个ajax表单。Im使用名为“pageMode”的bean变量来保存表单的状态(开始、确认等)。根据pageMode的值,我的jsf页面呈现或不呈现一些按钮。(启动时,仅显示提交按钮,提交后显示确认按钮…) 这是我的问题 当我第一次访问页面时,Submit按钮工作正常,但在我Submit之后Confirm按钮不能正常工作(不触发bean方法),这意味着pageMode=Confirm 我试图用h:pannelGrid包装我的按钮,并将rendred属性添加到按钮上。。没有工作:(
<h:form id="ApplicationForm" styleClass ="form-horizontal well">
<p:panel header="#{msg.bilgiler}" id="formVars" styleClass="well">
<h:panelGrid styleClass="defaultTable" id="pg" columns="2">
<h:outputText value="#{msg.ad}"/>
<p:inputText value="#{applicationFormInc.userData.userName}" rendered="#{applicationFormInc.pageMode=='start'}"/>
<h:outputText value="#{applicationFormInc.userData.userName}" rendered="#{applicationFormInc.pageMode=='confirm'}"/>
...
<p:commandLink styleClass="btn btn-primary" update="pg,confirmButtons" rendered="#{applicationFormInc.pageMode=='start'}"
action="#{applicationFormInc.confirmActionAjax}" value="Submit">
<i class="icon-remove icon-white"></i>
</p:commandLink>
<h:panelGrid id="confirmButtons" >
<p:commandLink styleClass="btn btn-primary" update="pg" rendered="#{applicationFormInc.pageMode=='confirm'}"
action="#{applicationFormInc.executeAction}" value="ConfirmAndSave" >
<i class="icon-remove icon-white"></i>
</p:commandLink>
</h:panelGrid>
</h:panelGrid>
</p:panel>
</h:form>
Thanx.定义您要使用CommandLink处理的内容-
<p:commandLink .... process="ApplicationForm" >
或者,如果您不想处理任何输入:
<p:commandLink .... process="@this" >
你能发布执行动作吗
代码?或者它的一部分吗?添加了执行动作。。。
<p:commandLink .... process="@this" >