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 Set Focus in Repeat Grid

SA-7644

Summary



Customer is using "Down key" in Repeat Grid and set actions as "Set Focus (Next Item), Run Data Transform (Page: Auto)" and when pressing down key it is not moving to next item sometimes.Sometimes it works fine,sometimes not.


Steps to Reproduce

  1. Open section ChooseNewProduct 
  2.  In Repeat Grid set Actions for "Down key" event: Set Focus (Next Item), Run Data Transform (Page: Auto).
  3.  Initialize this event.
  4.  Run flow AddProduct 
  5.  Press Down key in Grid


Root Cause



The root cause of this problem is the way the code is written.

Resolution




This issue is resolved through by writing java code in activity without using Data tansform for down key:-

String ref = tools.getStepPage().getReference();

int index = Integer.parseInt(ref.split("[\\(\\)]")[1]);

if(tools.getStepPage().getTopLevelPage().getProperty("pxResults").size() > index) {
    ClipboardPage sourcePage = tools.getStepPage().getTopLevelPage().getProperty("pxResults").getPropertyValue(index + 1).getPageValue();
    ClipboardPage targetPage = tools.findPage("SelectedProduct", false);
    if(targetPage == null) {
        targetPage = tools.createPage(sourcePage.getClassName(), "SelectedProduct");
    }
    
    targetPage.clear();
    targetPage.putAll(sourcePage, ClipboardPage.PUTALL_KEEPNEW);


}
 
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