This should be an easy question but I seem to be stuck. I have a datagrid with a list of panels with one field on it. When clicking on the paginator the data on the current page is lost. Is there a simple setting for this? I have other buttons within the panel and when I click on one of them the data gets submitted and does not get lost when I click on the paginator. So I know the backing bean (session based) is working properly. Only when I type data in the input and then use the pagination button does the data get lost. There must be a simple thing to make this work?? right? Shouldn't this just work by default?
I did see where someone captured each field value via ajax as the user types on each field but I do not think that solution is valid for my case. I do not wish to pound my server with that much activity.
I also moved to a datatable and added this line:
<p:ajax event="page" process="@form" update="@this" listener="#{cc.attrs.handler.test}" />
That resulted in capturing the event of the paginator being clicked but the data was not present.
Here is my page:
Code: Select all
<p:outputPanel id="serviceProviderModelPanel" autoUpdate="false">
<p:dataGrid id="serviceProviderModelGrid" var="serviceProviderModel" value="#{cc.attrs.model.serviceProviderRepeatModels}" columns="1"
rows="5" paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="5">
<p:column>
<p:panel id="serviceProviderModelpanel" header="#{tagbundle['tag.formschedulecp1-1.title']}#{serviceProviderModel.index + 1}#{tagbundle['tag.formschedulecp1-1.titleend']}" toggleable="true" closable="false">
<p:ajax id="serviveProviderCloseEvent" event="close" listener="#{cc.attrs.handler.deleteServiceProvider}">
<f:setPropertyActionListener value="#{serviceProviderModel.index}" target="#{cc.attrs.model.serviceProviderRepeatModelSelected}" for="serviveProviderCloseEvent"/>
</p:ajax>
<p:ajax event="toggle" />
<p:commandButton id="deleteServiceProviderbtn" update="@form" disabled="#{cc.attrs.handler.deleteDeactivated}" styleClass="right" action="#{cc.attrs.handler.deleteServiceProvider}" value="#{tagbundle['tag.formschedulecp1-1.btn.deleteserviceprovider']}" icon="ui-icon-trash">
<f:setPropertyActionListener value="#{serviceProviderModel.index}" target="#{cc.attrs.model.serviceProviderRepeatModelSelected}" for="removeFormCodebtn"/>
<!-- <p:effect type="drop" event="click" for="serviceProviderModelpanel" /> -->
</p:commandButton>
<h:panelGrid columns="1" style="width:100%">
<t:htmlTag value="fieldset">
<providerOther:directCompAmt model="#{serviceProviderModel.providerOther}" errorMsg="#{msgbundle['tag.formschedulecp1-1.msg.nobullet.form5500welfarecode']}" forceId="false" label="#{tagbundle['tag.formschedulecp1-1.lbl.schedulecdirectcompamt']}" layout="horizontal" displayType="input" />
</t:htmlTag>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
<p:outputPanel id="serviceProviderModelPanel2" autoUpdate="true">
<script type="text/javascript">
//<![CDATA[
// This is placed here because ajax reloads components and the jQuery
// bindings must be reset up and validation must be called.
javascript:bindOtherServiceProvidersForValidationAndHelp();
//]]>
</script>
</p:outputPanel>
</p:outputPanel>
Code: Select all
<t:inputText id="#{id}" forceId="false" rendered="#{(empty forceId or !(forceId eq 'true'))}" value="#{modelField}"
maxlength="#{maxLength}" size="#{size}" converter="#{injectConverter}">
<f:attribute name="fieldRef" value="#{errorMsg}"></f:attribute>
<t:div rendered="#{!(empty injectAjax)}">
<ui:include src="#{injectAjax}">
</ui:include>
</t:div>
</t:inputText>