0 Replies Latest reply on Sep 24, 2007 5:23 PM by Paul Thorp

    ClassCastException: org.richfaces.component.html.HtmlDatascr

    Paul Thorp Newbie

      I'm using RichFaces 3.1.0 and experiencing problems with datascroller not being refreshed back to first page after content of associated dataTable changes.

      So, I'm trying to fix this in code by getting the component from the UIViewRoot and then using the setPage() or setFirstRow() on the HtmlDatascroller component.

      However, when I try to cast the component found to an HtmlDatascroller I get a ClassCastException. I added a line of debug to show the class name of the component found, which, not suprisingly, came back as "org.richfaces.component.html.HtmlDatascroller".

      FacesContext c = FacesContext.getCurrentInstance();
      UIViewRoot root = c.getViewRoot();
      log.debug("[retrieve] scroller clazz[#0]", (root.findComponent("warrantySBIForm:warrantySBIScr").getClass().getName()));
      ((HtmlDatascroller)root.findComponent("warrantySBIForm:warrantySBIScr")).setPage("0");


      Has anyone else experienced this, or have any suggestions?


      Cheers,
      Paul