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.

showDiff: Text compare API for comparing properties

Updated on October 16, 2017

showDiff

This API is used to display differences between any property or text in an easy to interpret way in a dialog box that consists of two panes. The left pane that contains the current value is editable, and the right pane contains the reference value that the current value is being compared with. Changes are shown live as you edit the contents of the left pane.

The API does not save the text. After you click Done in the dialog box, the updated content from the left pane is passed to the callback function for users to perform any action.

The pega.ui.compare module is available for every harness.

Syntax

pega.ui.compare.showDiff(event, language, fetch, currentString, compareString, propertyName, currentLabel, compareWithLabel, doneCallback, cancelCallback, ruleClass);

Parameters

This API accepts a JavaScript object, which can have the following key-values. Arguments must be passed in the provided order.

  • event: The Javascript event object triggered by the action. Use the value javascript:event in the run script action.
  • language: The format of the compared strings. The available values are: application/x-jsp, css, html, jsp, js, javascript, java, text, text/x-java, text/plain.
  • fetch: If you are directly passing a string value in the currentString and compareString parameters, set this parameter value to 'string'. If you want the API to open the rule and retrieve the property value, set the parameter value to inskey and provide the inskey values of the rules to be compared in currentString and compareString parameters.
  • currentString: Property value or inskey of the current rule.
  • compareString: Property value or inskey of the compared rule.
  • propertyName: If the value of the fetch parameter is inskey, the name of the property to be compared after opening the rules. Otherwise, set as empty.
  • currentLabel: Header label of the left pane in the compare dialog box.
  • compareWithLabel: Header label of the right pane in the compare dialog box.
  • doneCallback: Callback function to be called after clicking Done in the dialog box. An updated string is passed to this callback.
  • cancelCallback: Callback function to be called after clicking Cancel in the dialog box. An updated string is passed to this callback.
  • ruleClass: pxObjClass value of the rule that is being compared for example Rule-Obj-Activity.

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