Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

pySelected is true in all the other pages

SA-32055

Summary



User has a Grid where it includes pySelected to select all the work objects. Clicking on the next page, it appears pySelected is still selected in the header, which should not be selected.


Error Messages



Not applicable
 

Steps to Reproduce



1) Open MyWork from the left navigation menu items.
2) In the worklist items, include a checkbox pySelected to select all.
3) Select that checkbox in first page all the work items will be selected. Now click on next page pySelected in true (check box is checked in the other page as well) which should not happen.


Root Cause



This is an expected behavior. pxCheckBox Select All does not work with pagination in repeating grids. 

Resolution



As a local change add below code as java step in pyPreGridUpdate activity. (when param.gridAction=="PAGINATE") 


String page = tools.getParamValue("pzPrimaryPageName"); 
tools.findPage(page).getProperty("pySelected").setValue("true"); 

int startIndex = Integer.parseInt(tools.getParamValue("startIndex")); 
int endIndex = Integer.parseInt(tools.getParamValue("startIndex")) + Integer.parseInt(tools.getParamValue("pyPageSize")) - 1; 
boolean loopThrough = false; 
if(endIndex>=startIndex){ 
loopThrough = true; 

while(loopThrough){ 
String pySelected = myStepPage.getPage("pxResults("+startIndex+")").getString("pySelected"); 
if(!pySelected.equals("true")){ 
String page1 = tools.getParamValue("pzPrimaryPageName"); 
tools.findPage(page1).getProperty("pySelected").setValue("false"); 
break; 


if(startIndex>=endIndex){ 
break; 

startIndex++; 


 

 

Published January 5, 2017 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice