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