Question

192
Views
MayanAlagar Member since 2010 41 posts
HCL Techonlogies
Posted: April 5, 2019
Last activity: April 5, 2019
Closed

Unable to refer gadget property in JS PegaV7.4

Hello All,

As per pdn articles, we can refer gadget property two ways,

1. [gadget/gadgetName/property]

2. pega.web.api.doAction("myGadget", "getGadgetData", "[.pxCreateOpName]")

We have below code

<button onClick="getLastName()" > Get Last Name </button>
<script>
function getLastName()
{
var mydataFromGadget=[gadget/PegaGadgetA/.pxCreateOpNam];
alert('hi');
alert(mydataFromGadget);
alert(pega.web.api.doAction("PegaGadgetA", "getGadgetData", "[.pxCreateOpNam]"));

}

</script>

<!-- ********************** Begin Pega content ********************** -->
<script src ='http://localhost:8080/prweb/PRServlet?pyActivity=pzIncludeMashupScripts'></script&gt;

<div

data-pega-gadgetname ='PegaGadgetA'
data-pega-action ='createNewWork'
data-pega-action-param-classname =[page/function/classname]
data-pega-action-param-flowname ='pyStartCase'
data-pega-isdeferloaded ='false'
data-pega-applicationname ='LangTrans'
data-pega-threadname ='ThreadA'
data-pega-resizetype ='stretch'
data-pega-event-onpagedata = "getData"
data-pega-url ='http://localhost:8080/prweb/PRServlet'&gt;

</div>

<!-- ********************** End Pega content ********************** -->

#1: it is not at all working

#2: It is throwing undefined.

Thanks

Data Integration
Moderation Team has archived post
Share this page LinkedIn