refresh of attributes problem with h:dataTable

Hi,

I have a dataTable with multiple pages. It works very nicely if you just page thru it

<h:dataTable id ="companyData" value='#{companyController.collection}' var='item' first="#{companyController.firstItem}" rows="#{companyController.batchSize}" >

Paging controls are like below:

<h:commandLink action="#{companyController.next}" value="Next #{companyController.batchSize}" rendered="#{companyController.showNextList}"/>

The methods like showNextList

depend on the programmatic methods getBatchSize()

and getFirstItem()

However I also have on the page a NewCompany link. If I go to NewCompany.jsp, add a new company and then return to the list, the list refreshes itself from the database (thus containing the new company), I zero my firstItem so the my paging controls know where we are: at the beginning of a new view of the data, however, no matter how I return to the dataTable, this control always thinks it is on the page that it left, not at the beginning of the list. It does not know that it is dealing with new data. I, with great hassle, obtained the reference to the class behind the dataTable and called dataTable.setFirst(0)

. It didn't seem to make a difference and created more problems as it couldn't find the dataTable every time..

The other place that the index for the first item on a page of data could be is in the DataModel (.getRowIndex()

) however when I refresh the data, a whole new model is created, thus rowIndex should be 0.

Has anyone any ideas?

regards

mark

[1805 byte] By [dukhaa] at [2007-11-26 19:14:54]
# 1
Try with already implemented dataScoller. Like myfaces tomahawk.
amitteva at 2007-7-9 21:16:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...