Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-1133

rich:datascroller does not reset when data model is changed

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.2.0
    • Component/s: None
    • Labels:
      None
    • Affects:
      Documentation (Ref Guide, User Guide, etc.)

      Description

      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);

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  nbelaevski Nick Belaevski
                  Reporter:
                  henrik.lindberg henrik lindberg
                • Votes:
                  13 Vote for this issue
                  Watchers:
                  13 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: