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

Incorrect behaviour of Previous and Next button

SA-2269

Summary



Next button is enabled though there is no next page to it. Previouss button is enabled though there is no previous page to it.

Error Messages



NA


Steps to Reproduce



1. Populate the data in repeat grid.
2. Configure to open the modal dialog while clicking the row.
3. Validate the fields which are in modal window with activity.
4. Mention the activity 
at flow action level in "Before the action" category.
5. Go to last page by clicking next button.
6. Give the values for fields in such a way that validation should fail.
7. Click on Previous button then error message will come and Next button is enabled though user at last page.
8. Come to first page.
9. Give the values for fields in such a way that validation should fail.
10. Click on Next button then error message will come and Previous button is enabled though user at last page.

Root Cause



When User at last page and click the Previous button, PRPC will try to show last but one page, so It enables the Next button by setting NextDisabled as false, But because of validation fails due to activity, Page still exists at lage page and  Next button is enabled.

When User at first page and click the Next button, PRPC will try to show second page, so It enables the Previous button by setting PrevDisabled as false, But because of validation fails due to activity, Page still exists at first page and  Previous button is enabled.

Resolution



User has mentioned activity at flow action level in "Before the action" category. Written below code in the activity as one of the step.

This step will be executed conditionally (Whenever validation fails). When there is page level message then only this code will be called.


String strPageListProperty = tools.getParamValue("rowPage");
int lastIndexOfBrace = strPageListProperty.lastIndexOf("(");
int lastIndexOfCloseBrace = strPageListProperty.lastIndexOf(")");
int index = Integer.parseInt(strPageListProperty.substring(lastIndexOfBrace+1,lastIndexOfCloseBrace)); 
ClipboardProperty propRef = tools.getProperty(strPageListProperty);
int size = propRef.getParentProperty().size();

if(index == 1)
{
    tools.putParamValue("PrevDisabled","true");
}

else if(index == size)
{
    tools.putParamValue("NextDisabled","true");
}
else
{
    // Not required
}
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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
Contact us