问题
Hi I have some validation on my form (Java web application), and when the validation is displayed, it should reload the page. When it does this, I lose all the data input in the dropdown list in first tab.(Data in text boxes are retained)
Below is how I define my tabview :
<p:tabView id="tabView" dynamic="true">
Anyone can help on this? Thanks in Advance
I am using PrimeFaces 4.0, spring, hibernate.
<h:form prependId="false">
<p:panel>
<h:panelGrid id="detail" columns="2" styleClass="grid"columnClasses="label,value">
<p:tabView id="tabView" dynamic="true" >
<p:tab id="tab1" title="bUS Details">
<h:outputTextvalue="#{ebusmsgs['ebus.bustitle.title']}:" />
<h:inputText id="ebus_bustitle" value="#{BusComponent.bus.empMinDiv}" />
</p:tab>
<p:tab id="tab2" title="Mechanic Details">
<h:outputTextvalue="#{ebusmsgs['ebus.mechanictitle.title']}:" />
<h:inputText id="ebus_mechanictitle" value="#{BusComponent.bus.empMinDiv}" />
</p:tab>
</p:tabView>
</h:panelGrid>
</p:panel>
</h:form>
来源:https://stackoverflow.com/questions/22953508/ptabview-is-not-keeping-track-of-data-when-page-is-reloaded-in-primefaces-4-0