Question
Capgemini
CA
Last activity: 25 Jun 2017 16:03 EDT
How to set javascript variable value to java variable in a control
I am trying to set a javascript variable to java variable in a javascript function.
I tried various ways, but failed.
Can any one help me.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
<script>
function setTest() {
var test = '<%=prop1%>';
}
</script>
Here prop1 is the java variable whose value is assigned to test.
Note: Place this code in HTML / HTML Fragment.
Capgemini
CA
Hi Sathish,
I am looking for setting javascript variable into java variable.
Not the opposite way.
Thanks,
Satya
Pegasystems Inc.
IN
It is unclear what your requirements are.
- Can you post the methods you have tried?
- Do you want to call an activity which accepts some value from client and sets a java variable?
- Or, do you want to do all this in a non-autogenerated control?
Capgemini
CA
In a non-autogenerated control,
I have a var test=10. I want to set it to a java variable string Index= test.
Infact, I want to set the javascript variable test to the current property of the control.
AI4Process Ltd
GB
Hi Murthy,
Did you find any solution for this ?
Pegasystems Inc.
IN
Have a look at this PDN article to see if this helps.
Pegasystems Inc.
US
AI4Process Ltd
GB
Below is working for me
<html>
<script>
document.getElementById("email").value=email;
</script>
<input type=hidden id="email" name="$PpyWorkPage$pSocialAccountEmail">
</html>
Pegasystems Inc.
IN
Hi,
As per my knowledge it is not possible but the reversal is possible as javascript is executed client side and the java is executed on the server side.
To directly set the value to the clipboard,you can use this:
<%tools.findPage("pyWorkPage").getProperty("name").setValue("test");%>
Please refer the following post:
https://collaborate.pega.com/discussion/how-process-agent-activity-3-different-intervals
-
Deexith Bairy charishma kambhampati