John
John

Reputation: 157

XPages Categorized View, Filtering and Paging

I have a view panel, based on a categorized view. I have a drop-down combo at the top of the page, which allows the user to select a category. This value is stored in the sessionScope.

The view uses 'Filter by Column Value' with the value computed to the sessionScope value.

This all works great, until they use the pager. They go to the second page, then try to change categories. This displays a blank view panel, presumably because the panel is trying to show the second page of results for a category with less than one full page of results. I say this because if they click on page one in the pager (or 'Previous') they get the correct results they should have gotten initially.

I have the drop-down set to do a Full Update, and tried onclick (which requires 'Partial Update') and also onchange event. How do I reset the panel to go to the first page of results when changing categories?

Upvotes: 1

Views: 1699

Answers (1)

W_K
W_K

Reputation: 868

The XspViewPanel class has gotoFirstPage function (with no params). Try to call it in onchange event of drop-down combo.

As Naveen suggested the code would looke like this (assuming that the view panel id is viewPanel1):

getComponent("viewPanel1").gotoFirstPage();

Upvotes: 4

Related Questions