[richfaces-issues] [JBoss JIRA] Commented: (RF-1133) rich:datascroller does not reset when data model is changed

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Thu Oct 18 15:32:06 EDT 2007


    [ http://jira.jboss.com/jira/browse/RF-1133?page=comments#action_12383326 ] 
            
Nick Belaevski commented on RF-1133:
------------------------------------

Actually, dataScroller works by setting "first" attribute of dataTable component. The issue is called by the fact that UIData class doesn't track models it uses so when the model has changed component still continues to use legacy "first" value pointing to non-existent rows.

As a variant I can suggest to implement PhaseListener so that it will traverse and reset all UIData instances in view before render_response phase using the follwoing reset criteria: "first" value is larger than a number of rows.

> rich:datascroller does not reset when data model is changed
> -----------------------------------------------------------
>
>                 Key: RF-1133
>                 URL: http://jira.jboss.com/jira/browse/RF-1133
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.1.1
>            Reporter: henrik lindberg
>         Assigned To: Nick Belaevski
>            Priority: Critical
>             Fix For: 3.2.0
>
>
> When the datamodel for a rich:dataTable is replaced with a new model the rich:datascroller still remembers its old page index.
> Now, in order to make it work, I have to look up the UIData and set the index to 0 when I change the datamodel.
> I would expect it to either be set to 0, or to the value of "first" attribute in the rich:dataTable when its model is changed.
> This problem is blocking me from releasing my application - I have *many* affected datascrollers and doing the following for all of them would not be fun...
> // how I reset the first value - perhaps there are beter ways to do this
> 		String id = "spaceForm:content_list";
> 		UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent( id );
> 		if(comp == null)
> 			throw new IllegalArgumentException("Can not find component with id = '"+id+"'");
> 		if(!(comp instanceof UIData))
> 			throw new IllegalArgumentException("Id does not refer to a UIData instance");
> 		UIData uidata = (UIData)comp;
> 		uidata.setFirst(0);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list