Table of Contents

Article

Public JavaScript API for control actions

Creating non-auto generated controls requires markup that contains specific attributes to represent events and actions. When these attributes are used, the Pega 7 Platform routes actions and events through the same infrastructure as the auto-generated controls.

Read More About Action Attributes

 

The Public JavaScript API allows you to treat custom controls like auto-generated controls in the Pega 7 Platform. The following set of APIs is available for creating custom controls. These are available in pega.api.ui.actions and pega.api.ui.actions.list namespace. In order to use any API, it should be invoked with complete namespace, for example: pega.api.ui.actions.refreshSection(params).

 

refreshSection

Refresh the current section or a named section. When refreshing a named section all sections with that name on the harness will be refreshed.

 

refreshHarness

Refresh the current harness.

 

postValue

Posts the value of the field to the clipboard when the field is bound to a property.

 

setValue

Set any target property from a source property or a literal constant.

 

setValues

Set any target property from a source property or a literal constant. Supports setting of multiple target properties through a single call.

 

runDataTransform

Run a data transform.

 

runActivity

The runActivity() method is used to run activity from script.

 

getDataPage

Get the data page data from the clipboard in JSON form.

 

setFocus

Sets focus on a field identified by the target property.

 

launchLocalAction

Launch a local action either as a modal dialog, overlay or by replace the current section.

 

addListItem

Add a new item to a grid or a repeating dynamic layout.

 

deleteListItem

Delete the active row in a grid, tree Grid, tree or repeating dynamic layout.

 

editListItem

Makes the active row in the grid, tree grid, tree or repeating dynamic layout editable.

 

openLocalAction

Launch a local action in a modal dialog in the context of a list item.

 

openURLInWindow

Open a URL in a browser window. The URL can either be a external URL or an internal (same domain) URL navigated through an activity or data transform.

 

getSection

Async API that returns the HTML markup of the section when rendered with the supplied clipboard page reference.

 

getSections

Async API that returns the HTML markup of a section as a JSON string rendered on each item in a list page.

 

launchHarness

Launch a harness. This can be configured to replace the current harness, open a new harness, or launch a harness in a pop-up window.

Published February 15, 2017 — Updated May 31, 2018


66% found this useful

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.