Question

getGadgetData in 7.2
I am trying to do a PoC with Pega Web Mashups in 7.2. I am having issues passing data out of my PRPC gadget from my sample page
I did not deploy prgateway.war but instead chose to generate the scripts from the casetype rule - settings - integration portion.
I tried to disable authentication following this link - https://pdn.pega.com/deploying-internet-application-composer-iac-intranet
I have the data showing in the Confirm harness inside the gadget on the page
I am finding that the function defined by PegaE_onConfirm is not being called when the confirm harness is loaded.
Calling the same js function from a button inside the javascript page throws a "access denied" error within one of the pega supplied-javascript files.
I have attached sample html file.
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Accepted Solution

Think I managed to solve it.
a) One issue was I was testing my html file as (file://<folder>/index.html and not http://localhost/<folder>/index.html.. The difference in protocol seemed to cause permission issues.
b) there seems to be 3 different ways to do data binding when calling getgadget as per documentation. The syntax that worked was pega.web.api.doAction(“PegaGadgetA”, “getGadgetData”, “.pyOrigOrg”)
c) I missed a step to add the fields as data field control in my "confirm" harness.

check if this helps if not already: https://community.pega.com/support/support-articles/iac-no-prgateway-authentication-does-not-work

I had set the RedirectGuests to false when I folloed the link above. But I will try again. Perhaps it didnt deploy correctly? I am using tomcat for my container.
There is a note in the end that I still need to deploy prgateway in my development environment? Do I need to do that if i can get the scripts through casetype rule form? Do I need to follow the other steps with IACAuthentication described here - https://pdn.pega.com/deploying-internet-application-composer-iac-intranet?

Why am I getting access denied to the PDN article mentioned? I am a customer.
Hi Saurabh,
PDN is experiencing technical problems and will be restored as fast as possible.
We thank you for your patience!
Regards,
Lochan | Online Community Moderator | Pegasystems Inc.

Please check if your invoking application and pega application are on same domain. Both should be in same domain.

Both are in localhost at the moment.
it is this line in my JS function that is throwing the "Access denied" error
I am calling getGagdetData this way:
var custNum = pega.web.api.doAction("PegaGadget", "getGadgetData", "pyWorkPage.CustomerNumber"); -
The "access denied error" seems to be coming at this particular line
_getGadgetData:function(D){var C=this._oFrame.contentWindow.document...
I also seem to be getting access denied errors when I try to invoke the PegaE_onConfirm = "onConfirmFunc" function

can you send me the html file and invoking application and pega application urls,portnumber(any dummy value should be fine)?

Hi - the index.html file is attached in the original post. It is a simple PoC at the moment.
Accepted Solution

Think I managed to solve it.
a) One issue was I was testing my html file as (file://<folder>/index.html and not http://localhost/<folder>/index.html.. The difference in protocol seemed to cause permission issues.
b) there seems to be 3 different ways to do data binding when calling getgadget as per documentation. The syntax that worked was pega.web.api.doAction(“PegaGadgetA”, “getGadgetData”, “.pyOrigOrg”)
c) I missed a step to add the fields as data field control in my "confirm" harness.

Hi Saurabh,
I have same requirement, can you please let me know how getGadgetData and setGadgetData can be achieved if pega contents are irrespective to workobject, for example- pega UI have simple bank form which is same across multiple applications.
This form content just few fields and business will populate them in pega and once completed these fields should get back to calling application.
Please let me know how we can achieve get and set data to pega. also can you please elaborate more on "c) I missed a step to add the fields as data field control in my "confirm" harness.". Do I need to set anything in harness to populate value from calling app
Thank you

I dont understand your use case. It seems it might make more sense to expose the data from Pega via SOAP/REST services?
If you havent already referred to the gadget manager reference guide on PDN, please do so. it would answer your how-to question.