Table of Contents

Article

launchHarness: Public JS API for control actions

launchHarness

Launch a harness. Can be configured to replace the current harness, open a new one or launch a harness in a popup window.

Syntax

var options ={<br />
harness:"harnessName",<br />
harnessClass:"className",<br />
displayMode: pega.api.ui.constants.REPLACE_CURRENT/ pega.api.ui.constants.POP_UP_WINDOW/ pega.api.ui.constants.NEW_DOCUMENT,<br />
tabName:{value:"Page1.Prop1", isProperty:true/false},<br />
contextPage:"Page1",<br />
windowName:"wName",<br />
windowWidth: No of pixels,<br />
windowHeight: No of pixels,<br />
readOnly:true/false,<br />
doSubmit:true/false,<br />
key:{value:"Page1.Prop1/pzInsKey", isProperty:true/false},<br />
activity: activityJSObject,<br />
dataTransform: dataTransformJSObject,<br />
displayHarnessFromServer:true/false,<br />
event: eventObj<br />
};

pega.api.ui.actions.launchHarness(options);

Parameters

This API accepts a JavaScript object which can have the following key-values.

  • harness: Harness name.
  • class: Class of the harness.
  • displayMode: Optional. Specifies how the harness would be opened. The default value is pega.api.ui.constants.REPLACE_CURRENT. If the harness is launched outside of a dynamic container, it always opens in a pop-up window. The following are valid values:
    • pega.api.ui.constants.REPLACE_CURRENT: Replaces the current tab or dynamic container contents with the new harness.
    • pega.api.ui.constants.POP_UP_WINDOW: Displays the harness in a new browser window
    • pega.api.ui.constants.NEW_DOCUMENT: Opens the harness and replaces the current dynamic container contents.
  • tabName: Optional. If the value matches the name of an open tab, the new harness replaces the tab. Otherwise, the new harness appears in a new tab. This is applicable only when the displayMode is New Document and Replace Current.
  • windowName: Optional. This is used by the framework to identify a browser window. If a window with that name is open, the new harness replaces the contents of that window. Otherwise, the harness appears in a new window. This is applicable only when the displayMode is Pop-up window.
  • windowWidth: Optional. This is a positive integer to set the window width in pixels. If windowWidth and windowHeight are not set, the browser replicates the dimensions of the current window. This is applicable only when the displayMode is Pop-up window.
  • windowHeight: Optional. This is a positive integer to set the window height in pixels. This is applicable only when the displayMode is Pop-up window.
  • contextPage: Optional. This is a string to render harness in the specified page context. When it is not set, the harness will be rendered in the primary page context.
  • readOnly: Optional. This is a Boolean to display harness contents in read-only mode. If it is set to false, the window name should be set in case of "Pop-Up Window" target. The default value is true.
  • doSubmit: Optional. This is a boolean to save the harness data before the UI framework replaces the harness. Can be used with Replace Current. The default value is true.
  • key: Optional. This is the key value (pzInsKey) of a data instance you want to automatically open as the new primary page when the harness is displayed. The system uses this value to identify the record. This action executes before a pre-activity (if defined). Used with New Document.
  • activity: This is a JSObject with the following key-values. This activity should return an HTML stream that displays in the opened window. This activity is processed after a data transform.

{name: “activityName", parameters: [{name: "param1", value: "Page1.prop1", isProperty: true}, {name: "param2", value: 123, isProperty: false}]}.

  • dataTransform: Optional. This is a JSObject with the following key-values.

{name: “dataTransformName", parameters: [{name: "param1", value: "Page1.prop1", isProperty: true}, {name: "param2", value: 123, isProperty: false}]}

  • displayHarnessFromServer: Optional. This option is only applicable for offline-enabled mobile apps. When it is set to true, it allows the mobile app to explicitly display a harness from a server instead of the one from the client store.The default value is false.
  • event: The event refers to a DOM event object.

Published February 15, 2017 — Updated April 6, 2017


100% found this useful

Have a question? Get answers now.

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