Question
HCL Technologies
IN
Last activity: 16 Oct 2018 12:03 EDT
Set property in clipboard using javascript without activity
Hi,
Is there any way to set a property in clipboard using java script without using activity? I'm using Pega 6.2 version.
I have tried the below code to set the property but it's not working
<script>
var setProp=100;
{tools.getPrimaryPage().putString("ClipboardProperty",setProp)}
</script>
Any help would be appreciate. Many thanks in advance.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi Arun,
You can use the following line of java code in javascript to set the value to clipboard
<%tools.findPage("pyWorkPage").getProperty("name").setValue("testing"); %>
HCL Technologies
IN
Hi Sarab,
Thanks for your response and sorry for my delay.
I have tried like the above suggested code but I'm getting error as 'Invalid Character constant' while save this Control after the changes. Also tried the below as well but it's not working.
var test=100;
{tools.findPage("pyWorkPage").getProperty("name").setValue(test);}
P.N: I'm using the code inside Java script in control.
Pegasystems Inc.
IN
Hi Arun,
I have tried in many ways to set the value of javascript variable to java and found that 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");%>
Pegasystems Inc.
IN
- As you mentioned, activity is one way of doing it
- Otherwise, you can use pxHidden control with property you want to set. And then use pega.u.d.setProperty method to set the property on DOM. Then On Change of that property, you can configure post value
Let us know if this helps
Evonsys
LK
could you please briefly explain , how to use the pxHidden control to set the java script variable to the clipboard
Pegasystems Inc.
IN
Use pxHidden control on the screen with the property that you want to set on the clipboard. Configure Event/Actions as On Change/PostValue.
Now call the setProperty method from java script to set the value to that property.
Let us know if this helps :)
-
Vittal Srimattirumala
AI4Process Ltd
GB
<html>
<script>
document.getElementById("email").value=email;
</script>
<input type=hidden id="email" name="$PpyWorkPage$pSocialAccountEmail">
</html>