Question

216
Views
Close popover
Alagar Pandi Pandi (MayanAlagar)
HCL Techonlogies
Technical Architect
HCL Techonlogies
IN
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,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.