Posts

Showing posts with the label javascript

Refresh a section on client using JavaScript

Just execute the following JavaScript function:

pega.api.ui.actions.refreshSection({section: "MySection"})

Of course, we can set a parameter to run a data transform or call an activity. Keep reading!

How to call an activity from the client using the "asyncRequest" JavaScript function

Image

Here is an example where we invoke the pyUtilityStub activity using the POST method by sending GET and POST parameters at the same time:

var oSafeURL = new SafeURL("@baseclass.pyUtilityStub");
oSafeURL.put("pzPrimaryPageName", "pyWorkPage");
oSafeURL.put("parameterGet1", "valueGet1");
oSafeURL.put("parameterGet2", "valueGet2");

var postData = new SafeURL();
postData.put("parameterPost1", "valuePost1");
postData.put("parameterPost2", "valuePost2");

pega.u.d.asyncRequest("POST", oSafeURL, null, postData);