Skip to main content

Externalizing dialog parameters

When a D2FS dialog is getting built, it can take a set of input parameters under consideration. Depending on implementation and business logic of a dialog, such input parameter can control how the dialog is built and how it behaves post build, during validation or cancellation.

Means of parameter definition

  1. Coding - On the client-side, DialogAction or StateMethod relevant for a dialog can literally construct such parameter set in the code and pass it off to server-side.
  2. Configuration - As dialog execution almost always starts from a menu item. The configuration for the menu item can declare parameters and their values through message field in D2-Config. If present, these parameters are automatically passed off to server-side.

Externalizing dialog parameters refers to the Configuration method.

tip

Two common input parameters form_mode & viewMode exists for all dialogs. The former controls readonly vs editable view of a dialog whereas the latter controls modal popup vs side-panel based appearance of the dialog. Point to remember though - once dialog execution starts, and it becomes visible on the UI, then changing these parameter values would have no effect till the end of execution

info

In a multi-dialog business flow, the entire input form data collected in a dialog, is passed-off to the next possible dialog as input parameter.

Leveraging PropertiesDialog for customization

In case if the business requirement for the dialog is simple and doesn't require a lot of customization. Then developer can use the OOTB PropertiesDialog to map a property page config present in the system. This can be done as part of menus configuration to showDialog. property_config input parameter can be defined as part of the message parameter which will drive the customization. Additional parameters can also be passed.This will help development in 2 ways.

  1. Instead of matrix evaluated property page, admins can now point to a different property page
  2. Along with the property page config if there are other custom parameters that can be used to drive a customization in the D2DialogServicePlugin which will have access to those custom parameters as well as the property page values. Thus, developers can write their custom operation in D2SFS overrides.