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

JavaScript Depending on Parent.Name Value Not Working

SA-5704

Summary



Developers notice that javascript nested in a html block no longer works in Pega 7.1.6. It used to work from PRPC 6.3 SP1. The javascript in question references the Parent.name property and it appears to be blank in the updated context.

Error Messages



N/A

Steps to Reproduce

  1. Create a HTML Rule which contains conditions that occur only when parent.window equals a certain value
  2. Configure a portal menu control to call OpenUrlInWindow for the html rule described above
  3. Test the scenario and confirm the conditions which depend on the parent window being a certain value are not executed

Root Cause



The root cause of this problem is a defect in customer application code/rules. The menu navigation rule needs have a value for a window name specified. The javascript must also take into account that this name is just appended to the requestor and as such can't be a simple equality statement.

Resolution



This issue is resolved through the following local change:
  1.  Update menu navigation rule to include the window name 
    1. Open Navigation Rule
    2. Select OpenURLInWindow Menu Item
    3. Click Actions Tab
    4. Update Window Name
  2. Update the javascript to search if the window name contains the string of interest
if(parent.name.indexOf('StringOfInterest')>-1){}
   

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% 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?

Want to help us improve this content?

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