Support Article
Unable to set Clipboard page property to variable in external JS
SA-63644
Summary
Unable to set a Clipboard page property to variable in external JavaScript file.
Error Messages
Not Applicable.
Steps to Reproduce
- Create a Text (JS) file and code the statement
- Add the Pega tag inside the JS file and assign it to a variable
- Run the JS file. The Pega reference tag is not resolved
Root Cause
Pega JavaServer Pages (JSP) tag is not recognized in the external JS file. Thus, the user was unable to get the Clipboard page value using the Pega tag inside JS file.
Resolution
Perform the following local-change:- Inside a UserWorkForm create a variable and get the value from the Clipboard:
<script>
var testvar = '<%= tools.findPage("pxRequestor").getIfPresent(".pxReqLocale").getStringValue(); %>';
</script>
- Refer the above testVar in the JS file
Published January 4, 2019 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.