1
votes

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?

1
Though it doesn't relate to this issue, wouldn't it be better to have that value in the viewScope instead of sessionScope, so that if they switched pages to one that uses the same sessionScope variable to store categories that it wouldn't still be using the same value?David Navarre

1 Answers

4
votes

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();