Argument bindings

Description

Settings for assigning values to arguments for an embedded component.

Discussion

If an embedded component has one or more arguments, the Argument bindings property can be used to assign the value for one or more arguments. When the smart field button is clicked for the Argument bindings property, it will open the genie for configuring the embedded component.

If the component has arguments, the Set Argument Values section will be shown. In this section, you will see a list of arguments defined for the component, as well as the assigned Argument Value and Default Value.

images/embeddedCompGenie.png

Setting the Argument Value

An argument's value can be assigned by selecting it in the list of arguments and clicking the Set Argument Value button.

An argument's value can be set to one of the following:

  • A constant value. E.g. "Smith"
  • The value in a session variable. E.g. "context.session.customerID"
  • The value in a field on the component. E.g. "{customer_id}"
  • The result of a JavaScript function call. E.g. "(Javascript:functionName)". See below for more information.

The Insert Field Placeholder button can be used to select a control in the component to use to get the value for the argument.

images/setArgumentValue.png

Setting an Argument Value to the Result of a Javascript Function Call

You can set an argument to the value of a JavaScript function call. This done by using the following syntax to specify the JavaScript function that should be called to compute the value:

(Javascript:functionName)

where functionName is the name of the JavaScript function to call. JavaScript functions are typically defined in the Javascript Functions section of the UX Builder.

Note that the syntax for specifying a JavaScript function is wrapped in parentheses.

If the embedded object is a Grid Component, the function you define will need to take rowNum as an argument. For example:

function getLinkValue(rowNum) {
    var data = {dialog.EmbeddedGrid_myGridAlias}.getValue('G','FIRSNAME',rowNum) + ' ' + {dialog.EmbeddedGrid_myGridAlias}.getValue('G', 'LASTNAME', rowNum);
    return data;
}
Replace myGridAlias with the alias you give the embedded grid. The embedded Grid's alias is defined in the Component alias property.