Primefaces选项卡未正确更新
我有一个与commandButton的对话,这就是我想要做的:Primefaces选项卡未正确更新,primefaces,page-refresh,commandbutton,Primefaces,Page Refresh,Commandbutton,我有一个与commandButton的对话,这就是我想要做的: 做一些Java工作 更新Primefaces选项卡 让我的对话框消失 去那个特定的账单 这是我正在使用的代码: <p:commandButton value="Submit" action="<some java work>" oncomplete="dialogue.hide(); sideTabs.select(1)
<p:commandButton value="Submit"
action="<some java work>"
oncomplete="dialogue.hide(); sideTabs.select(1)"
update="<update side tab">
</p:commandButton>
问题是,这只在刷新之间工作一次。我的意思是,我点击按钮,一切正常。选项卡更改为请求的选项卡,选项卡更新,对话框消失。但是,当我再次单击按钮时,请求的选项卡确实被选中,但在我点击f5之前不会正确刷新。一旦我这样做了,我可以再次单击对话框按钮,选项卡将再次正确刷新,但再一次,只有一次-直到我再次点击f5。比如说:
谢谢 我试图复制这个问题,但没有成功 下面是我的ViewScoped bean中的属性的示例:
private String str1 = "a";
private String str2 = "b";
private String update = ":f:t";
private Integer index = 0;
以下是观点:
<h:form id="f">
<p:tabView id="t" widgetVar="tVar" activeIndex="#{viewMBean.index}" >
<p:tab id="a" title="A" >
#{viewMBean.str1}
</p:tab>
<p:tab id="b" title="B">
#{viewMBean.str2}
</p:tab>
</p:tabView>
</h:form>
<p:dialog id="d" widgetVar="dVar">
<h:form>
<p:inputText value="#{viewMBean.str1}" />
<br />
<p:inputText value="#{viewMBean.str2}" />
<br />
<p:inputText value="#{viewMBean.update}" />
<br />
<p:inputText value="#{viewMBean.index}" />
<br />
<p:commandButton value="Submit" update="#{viewMBean.update}" oncomplete="dVar.hide();" />
</h:form>
</p:dialog>
#{viewMBean.str1}
#{viewMBean.str2}
我相信问题出在代码的其他地方。问题确实出在其他地方。谢谢你的帮助:)