richfacesrichdatatable

Richfaces: Issue with HTML generation of datascroller/datatable


I'm using RichFaces 3.3.1 with JSF RE 1.2 and facelets. I have a strange issue with the HTML generation of a rich:dataTable connected to a rich:datascroller.

<h:form id="br">
...
 <rich:datascroller id="scrt" page="#{searchBookings.page}" stepControls="hide" renderIfSinglePage="false" for="bt" align="left" reRender="ttips,bt"/>
 <rich:dataTable id="bt" rows="20" rendered="#{!empty searchBookings.bookings}" value="#{searchBookings.bookings}" var="row" binding="#{searchBookings.table}">
....

The first time the page loads, everything works nicely. If i visit the same page a second time, changing pages via the datascroller doesn't refresh the datatable any longer. Hitting the refresh button solves the problem.

Adding a4j:log revealed this warning:

 warn[14:50:07,259]: Node for replace by response with id br:bt not found in document

Indeed, when inspecting the HTML, the "correct" page looks like this:

  <table class="dr-table rich-table " id="br:bt" ....

Whereas the "bad" page looks like this:

  <table class="dr-table rich-table " id="br:bt:0" ....

Notice the ":0" at the end of the ID, it shouldn't be there. What could be causing this?

Thanks for any input.


Solution

  • ok found it. somewhere in the backing bean i did

    table.setRowIndex(0);

    what i meant to do was

    table.setFirst(0);

    The former apparently makes the generator assume he's generating rows, so he returns a row id, appending ":0". No idea how this only affects the second time the page is generated though. Hope this is useful to someone else once.