Last activity: 16 Dec 2015 10:24 EST
Yes Rasaiya. Here are 2 ways for your reference. Give a try in a HTML control or a HTML rule and see the syntax & all. Check this OOTB rule: ActionDropDown, AddWork
var testvar = "<%= tools.findPage("OperatorID").getProperty(".pyUserIdentifier").getStringValue(); %>";
<script for="window" event="onload">
var testvar = "<pega:reference name="OperatorID.pyUserIdentifier"/>";
Will try and share the results âº
Hi Ravi ,
This question is for knowledge purpose.
It worked, but problem is, it is set only once.
consider the following code.
/////////////////////////////////code starts here
run a activity through js which sets a property in the clipboard.
If the value set in the clipboard s A
then do Action 1
do Action 2
/////////////////////////////////code ends here
If I put the above code in the function in the html rule and call it twice.
It executes the action that is executed first time twice even if the value in the clipboard has changed.
Yes that is true. The scriplet will get executed only when the JS is getting loaded and not always when the JS function is called.
So incase you need to get fresh data again, you may need to refresh the section having the jS code i.e. reload it.
Hi Ravi, useful for me! One question: do you have a hint where I can find a good documentation on these objects (tools) and methods (findPage, getProperty etc) that I can share with my customer?
would be a good place to start.
Use a Show-Property method that returns either a property value or parameter to your session and that gets captured in the js variable "thisVar"
var oSafeUrl = new SafeURL("ActivityName");
var thisVar = pega.u.d.asyncRequest('GET',oSafeUrl);
To return the whole page, use Show-Page.
Look at how DynamicSelect returns the list of selected-items back to the browser. It uses ajax. I think you just need to use a Code-Pega-List and show-html. /Eric
Updated: 9 Dec 2015 0:40 EST
Need to check syntax for ajax, I thought there would be in buit js api which does this
Although the answer is yes, a more within-guard-rails way to do it, which was alluded to before, would be:
1) Have a section on which you expose a property or list with appropriate Pega designer studio features.
2) Include a button or link on the section whose action list includes "refresh"
3) When the latest version of the clipboard property value is needed, the user clicks the button.
To keep things simple , I thought there would be some api getvalue(Page.Property)