Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

launchHarness: Public JS API for control actions

Updated on April 6, 2017

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

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.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us