[英]JSF 2 Page not refreshing after action completes
I'm having an issue where my page is not refreshing after an action completes. 我遇到一个问题,即操作完成后页面没有刷新。
I have this form on a page: 我在页面上有此表格:
<h:form id="fundingResults">
<p:ajaxStatus style="width:16px;height:16px;">
<f:facet name="start">
<p:graphicImage value="/images/loading4.gif" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
<p:dataTable>
// some form elements in the table
</p:dataTable>
<p:commandButton id="btnEdit" value="Submit" type="submit" action="#{fundingBacker.classifyProducts}" style="float: right;margin-top:15px;" />
</h:form>
My classifyProducts method skeleton is like this: 我的classifyProducts方法框架如下所示:
public void classifyProducts() {
// a bunch of stuff goes on in here
}
Shouldn't the page refresh automatically after the classifyProducts() method completes because of implicit naviation? 由于隐式导航,classifyProducts()方法完成后页面是否不应该自动刷新?
Primefaces command buttons send ajax requests by default. Primefaces命令按钮默认情况下发送ajax请求。 Try to add attribute
ajax='false'
to p:commandButton
. 尝试将属性
ajax='false'
添加到p:commandButton
。
You need to specify what parts of the page to refresh. 您需要指定要刷新页面的哪些部分。 For example adding update="@form" to the commandbutton tag should to the trick here, or you could specify the id of the individual components to update.
例如,将update =“ @ form”添加到commandbutton标记应该是这里的窍门,或者您可以指定要更新的各个组件的ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.