I’m using an async table to display query results in a portlet. It’s set to display 10 rows with the ability to navigate to the next/prev page when there are more rows returned. My problem comes in when I run a query that returns >10 rows and I then navigate to the next page, then run a new query which returns <10 rows. I get a message “Beyond End Of Data” and have to click on “previous” in order to view the results.
Is there any way to reset the table to the first page when I run the query?
I think so… the table is “linked” to a web service call, and clicking the Query button executes the Refresh() of the web service. Does this refresh the table automatically? Or do I have to do it manually in code?
well, if you use an Async Command Button to call the WSC and leave its refresh property empty (which should refresh the whole view), that should refresh the table as well…
what happens if you explicitly set the refresh of your button to refresh the table?
Tried the refresh property (of the async command button) as empty and specified to the table and although it does seem like it’s refreshing, it’s not going back to the first page, it stays on the page saying “Beyond End Of Data”
You can adjust the table’s paging state in your action by getting a
reference to the table component (you can create a getter for this on
your page bean by right-clicking the control in the view editor and
selecting Source > Create Control Accessor) and setting
the table component’s “first” property to the index of the first row to
display, and/or its “rows” property to the number of rows to display.
Alternately, if you have those properties bound to a property on some
bean (like your page bean), you can just adjust those properties on that
With the jsf table’s design the paging of the ui is independent of
the data model. The ui (the table control) doesn’t necessarily know
when the data model changes, or whether it’s been changed by a ui add
operation or by some remote change to the back-end data store. That’s
why you have to manually adjust the table control’s paging state.