DataGrid paginator data lost

UI Components for JSF
Post Reply
sachst
Posts: 15
Joined: 23 Feb 2012, 19:14

23 Mar 2012, 22:40

I am using Primefaces 3.1.1

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>


here is the directCompAmt tag (t is the tomahawk component inputText. We use the forceId feature. )

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>

sachst
Posts: 15
Joined: 23 Feb 2012, 19:14

24 Mar 2012, 03:51

I also found this: http://code.google.com/p/primefaces/iss ... il?id=3026

This seems like the same issue. Any one out there??

I am still stuck on this one...

sachst
Posts: 15
Joined: 23 Feb 2012, 19:14

02 Apr 2012, 18:20

This was an issue with Primfaces. By design, Primefaces was not updating the backing bean when pagination executes. After some discussion with them they agreed that the components that use a paginator (dataList, DataTable and datGrid) should be updating the backing bean.

They have put a fix out under primefaces-3.3-SNAPSHOT. There is a JIRA log for this but I think you need to have purchased support to see it.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Apr 2012, 18:33


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 46 guests