Discussion

tools.findPage("pyWorkPage") not working in js

hi,

None of the below mentioned piece of code is working in javascript:

alert('test'+ '<%= tools.getRequestor().getRequestorPage()%>');
var tst ='<p:r n="<%= tools.findPage("pyWorkPage").getString("pyFlowName")%>"/>';
var tst1 ='<pega:reference name="<%= pxRequestor.pxApplicaton%>"/>';
var tst = '<pega:reference name="pyWorkPage.name" mode="NORMAL"/>';

In alert, its showing complete string not its value.
Please suggest some solution.
Thanks.

**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.

Comments

Keep up to date on this post and subscribe to comments

July 31, 2012 - 10:17am

Which rule contains this piece of code?

July 31, 2012 - 11:48am

Use the below piece of code.

<%
String Id=tools.findPage("pyWorkPage").getString(".pyID");
%>

<script>
var Id="<%=Id%>";
</script>

August 1, 2012 - 2:53am

THe rule is of text file type

quote:


Originally posted by SADATSAEED

Which rule contains this piece of code?

August 1, 2012 - 2:58am

but, can we use <% %> in js code....becoz this a js file

quote:


Originally posted by lakshmicts

Use the below piece of code.

<%
String Id=tools.findPage("pyWorkPage").getString(".pyID");
%>

<script>
var Id="<%=Id%>";
</script>


August 1, 2012 - 10:35am

A Text file rule does not support JSP tags or directives. Use HTML Fragment instead.

August 6, 2012 - 3:17am

fine...but how to call a html rule on click of right click....as there is run script to run a file in navigation rule but no run html kind of thing

quote:


Originally posted by SADATSAEED

A Text file rule does not support JSP tags or directives. Use HTML Fragment instead.

Pega
April 19, 2016 - 9:50am
Response to RINKU003

>>  RINKU003 said:  fine...but how to call a html rule on click of right click....as there is run script to run a file in navigation rule but no run html kind of thing

Are you using Pega 7 ?  

And what exactly are you wanting to right click on?

In Pega 7 you can define Right-click Events for various OOTB controls.

For an Action you can specify "Run Script" but to simply set a value on the Clipboard you have a number of options:

  1. Post Value
  2. Set Value
  3. Run Data Transform

Are you attempting to write a custom control?

BTW:  "tools" is valid for both client-side JS and server-side coding but are different.  You were confusing the server-side java Engine API use of "tools" with the Pega-Desktop javascript client-side API's use of "tools".

 

June 11, 2013 - 7:17am

Please let us know what is your requirement, for calling html control on right click

 

March 17, 2016 - 7:17am
Response to ASHOKG123

Can any one give me the code set a value for property in clipboard??

Pega
April 12, 2016 - 4:22pm

Can you please add more detail to you question, like what are you trying to do.

Thanks,

Bill Rathert