-
1. rich:Datascroller doesn't change the displayed content of my datatable
ilya_shaikovsky Jan 17, 2011 4:13 PM (in response to romeo_zdrite)rf version? and add some code.
-
2. Re: rich:Datascroller doesn't change the displayed content of my datatable
romeo_zdrite Jan 20, 2011 10:13 AM (in response to ilya_shaikovsky)Hey,
I'm using richfaces 3.3.0. I've used the same version a few months ago when doing some university related projects, without this problem.
This time I'm also using JQuery but I've set it so it won't intefere with richfaces (renaming the $ variable) and other components seem to work as they should now.
The datascroller and datatable header are placed inside a form tag and they look like this
<rich:datascroller action="afisare" id="sc1" reRender="sc2" for="table" maxPages="10" page="#{menuBean.pagina}" > </rich:datascroller>
<rich:dataTable id="table" value="#{menuBean.lista}"
var="anunt" rows="10"
rowKeyVar="rowKey"
columnClasses="photoColumn,textColumn,priceColumn,dateColumn">
At the end of the datatable I have a similar datascroller, synchronized with the first one:
<rich:datascroller action="afisare" id="sc2" reRender="sc1" for="table" maxPages="10" page="#{menuBean.pagina}"></rich:datascroller>
The action="afisare" parameter makes the page refresh when clicking the datascroller and this is the parameter I want to skip. i.e. refresh the table without refreshing the page.
The datatable contains some controller that trigger some javascripts and open a modalpanel, if this code might interfere with the refresh of the datatable please tell me and I will paste it here.
The getter of the array to be displayed is straight forward, as follows:
public ArrayList<Anunt> getLista() {
return lista;
}
I am populating the array in a different method when the navigation to the displaying page is triggered, in the following method:
public void populeazaLista(ArrayList<SearchCriteria> crit) {
lista.clear();
AfisareService as = new AfisareService();
lista = as.returneaza(crit);
}
In the method above lista is populated from a database. It contains enough entries to fill 4 pages of the table, 10 rows each.
The bean that holds the navigation logic, the array to be displayed and the populating method is session scoped. The last lines of the method that navigates to the table page are the following:
populeazaLista(crit);
return "afisare"; //afisare.jpg is the jsf page that displays the datatable
If I missed any relevant code, please tell me, and thanks in advance.
Also from time to time it doesn't display the richfaces components, on refresh (but only when I force the refresh from the datascroller), but just plain text. The application is deployed on glassfish 3, but don't know if the server is the problem or something in my application.