Reputation: 426
I added a checkbox to my search panel, the search is working initially in the sense if I select the check box and add a query string I am getting the expected result in the table. If I click on the column header and try to sort it my table gets reset with the filtered out result.
I figured that the executeQuery of the ViewObject is getting called each time I am clicking on sort. I added code to set the value of the viewCriteria attributes here but tat is also not working. My executeQuery method included below;
public void executeQuery() {
ViewCriteria vc = this.getViewCriteria("RegionMasterCriteria");
if (null != vc.getCurrentRow()) {
if (null != vc.getCurrentRow().getAttribute("Active") &&
vc.getCurrentRow().getAttribute("Active").equals("true")) {
setActiveVariable("Y");
} else {
setActiveVariable("N");
}
}
super.executeQuery();
}
vc.getCurrentRow() is null when I am trying to perform search. The Criteria is has Auto query set to true so that when the page loads the table has default search data. But then why will vc.getCurrentRow() become null..
Upvotes: 0
Views: 445
Reputation: 1657
Can you try using executeQueryForCollection(java.lang.Object qc, java.lang.Object[] params, int noUserParams)
instead of executeQuery()?
You will be able to find your "Active" view criteria attribute in method argument:
java.lang.Object[] params
just keep in mind 'params' is a matrix (array of arrays).
Upvotes: 1