eoro34 Member since 2018 15 posts
Posted: 4 months ago
Last activity: 4 months 4 weeks ago

Issue with getting updated property on clipboard using Javascript

I have a pega button that runs 2 actions on click:

1 - run script that just gets the value of "MyProperty" on clipboard.

2 -  a data transform that edis the value of "MyProperty" whether if it's true or false

I'm having an issue getting the updated value based on the data transform result the next time I click on the button.  

I have a function on a custom html that is supposed to get the value of "MyProperty" whenever the button is pressed.

For getting the value on the clipboard, I've tried. var testvar = '<p:r n=".MyProperty"/>';

var testvar ="<pega:reference name=".MyProperty" mode="javascript"/>";

var testvar = "<%= tools.findPage("pyWorkPage").getProperty(".MyProperty").getStringValue(); %>";

var testvar = '<%= tools.findPage("pyWorkPage").getIfPresent(".MyProperty").getStringValue() %>';  

If the current value of "MyProperty" on clipboard is "true" when the custom html loads, it will only get that "true" value instead of the updated one via data transform.

I have also tried adding Post Value but it does not seem to work either.

Any reason why this happens or can anyone point me to the right direction on this one? UPDATE: refreshing the whole page not just the html that has those line fixes it. However I need a way where it doesn't refresh the whole page

***Edited by Moderator: Pallavi to update platform capability tags***  

Pega Platform 8.1 User Interface
Share this page LinkedIn