Question

1
Replies
113
Views
erick orosco (eoro34)
ACN

ACN
PH
eoro34 Member since 2018 16 posts
ACN
Posted: June 1, 2020
Last activity: June 1, 2020
Posted: 1 Jun 2020 1:41 EDT
Last activity: 1 Jun 2020 8:06 EDT
Closed

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

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 Experience
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.