Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
Pegasystems Inc.
JP
Last activity: 3 Jun 2022 0:44 EDT
How to return a value to a clipboard property from custom control?
Hi,
If I created a custom control, for example a date picker by using 3rd party javascript library, how can I return
the value from custom control to the clipboard property which has been set to hold the custom control value?
***Edited by Moderator Marissa to update Platform Capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 3 Jun 2022 0:44 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-11/a40e7a59-6e09-4ece-971d-a6dd1f01daa6.jpg?h=00b6e95b&itok=uEClXheI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-11/a40e7a59-6e09-4ece-971d-a6dd1f01daa6.jpg?h=00b6e95b&itok=uEClXheI)
Capgemini
NO
Hi Liang,
You can use the below code to pass the value from Custom control to the clipboard.
<input type="hidden" name="<pega:reference name="$this-name" />" id="<pega:reference name="$this-Definition(pyPropertyName)"/>" value="<pega:reference name="$this-value" />" />
The above HTML code contains Pega JSP tags which render property ID which is mentioned in the control, name tag value(generated based on clipboard structure), and value if exists from the clipboard.
In the browser, it will render like below:
<input type="hidden" name="$PpyWorkPage$ppyNote" id="pyNote" value="234234234">
I have configured .pyNote to the control. It will post value to the pyWorkPage.pyNote of value "234234234".
You can set the value to the above tag to post value to respective property. Here is the sample JS code.
var propid = "<pega:reference name='$this-Definition(pyPropertyName)'/>" ;
document.getElementById(propid).value = YOUR VALUE;
When the user submits the flowaction, the current value in the "value=" tag is posted to the clipboard to respective control property.
Let me know if you have any more questions.
Good Luck !
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
US
I am not sure I understand the question correctly
Property holds the value, control decides the way it is displayed
For e.g. ".Name" property can be displayed as a "textInput" / "textArea" control. The control itself does not have a value associated with it.
Are u talking about some kind of "edit-input" which will say automatically insert "-" in phone numbers (say converting "01234567890" -> "123-456-7890" ) . Do you want this to be reflected in the property ?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
Pegasystems Inc.
JP
Thank you for your reply.
(Property holds the value, control decides the way it is displayed. )
For example, there is a property [ .BirthDay ], and because there is no
OOTB datepicker control satisfy my requirement, so I created a custom control (datepicker)
by 3rd party library. Now my question is how to return the value to property [.BirthDay]
from my custom control rule?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689955000/093348bc-682b-4901-bb5d-609442ca6f9c.png?itok=UxHpQrrz)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689955000/093348bc-682b-4901-bb5d-609442ca6f9c.png?itok=UxHpQrrz)
Maantic Inc
US
hope you have the new date picker control in UI form, when you call the new control which property you are using? Can you confirm what values the property has when the form is submitted ?
if possible show the screen print, how the new property called in UI and when it is submitted.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
Pegasystems Inc.
JP
Thank you for your reply, I will post screen captures.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689967000/472aea40-e315-45b4-bd3b-b1ff22c9f0f7.jpg?itok=TSmmPBxv)
Pegasystems Inc.
JP
Here is some screen captures for my issue.
1. The DateTime property for hold the date picker value.
2. Date picker and property setting.
3. Custom date picker control on screen
4. Custom control setting.
Accepted Solution
Updated: 3 Jun 2022 0:44 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-11/a40e7a59-6e09-4ece-971d-a6dd1f01daa6.jpg?h=00b6e95b&itok=uEClXheI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-11/a40e7a59-6e09-4ece-971d-a6dd1f01daa6.jpg?h=00b6e95b&itok=uEClXheI)
Capgemini
NO
Hi Liang,
You can use the below code to pass the value from Custom control to the clipboard.
<input type="hidden" name="<pega:reference name="$this-name" />" id="<pega:reference name="$this-Definition(pyPropertyName)"/>" value="<pega:reference name="$this-value" />" />
The above HTML code contains Pega JSP tags which render property ID which is mentioned in the control, name tag value(generated based on clipboard structure), and value if exists from the clipboard.
In the browser, it will render like below:
<input type="hidden" name="$PpyWorkPage$ppyNote" id="pyNote" value="234234234">
I have configured .pyNote to the control. It will post value to the pyWorkPage.pyNote of value "234234234".
You can set the value to the above tag to post value to respective property. Here is the sample JS code.
var propid = "<pega:reference name='$this-Definition(pyPropertyName)'/>" ;
document.getElementById(propid).value = YOUR VALUE;
When the user submits the flowaction, the current value in the "value=" tag is posted to the clipboard to respective control property.
Let me know if you have any more questions.
Good Luck !