DynaFieldDef Components

DynaFieldDef is a data model used to store the "schema" of a DynaField in the database. These can be pre-loaded via CSV files using inbound interfaces, or one can use the PLT.DynaFieldComopnentReport to allow administrators to view and add them through the UI.

Here is a sample configuration of a WebAction you can create and add to your RoleTypeUIConfig:

<WebAction name="DynaFieldDefReport">
<PanelOptions>
<PanelClass>One.Report</PanelClass>
<PanelConfig><![CDATA[{reportName: 'PLT.DynaFieldComponentReport', autoExecute: true}]]></PanelConfig>
</PanelOptions>
</WebAction>

Procedure 4.25. To define "Components" for the DynaField.

  1. Open the DynaFieldDefReport from newly added WebAction:
    images/download/attachments/144835186/dynafielddef_report-version-1-modificationdate-1645042891000-api-v2.jpg

  2. Click the "Create DynaFied" button. It will open a model form for the DynaFieldDef model:
    images/download/attachments/144835186/create_dynafield-version-1-modificationdate-1645042905000-api-v2.jpg

  3. Select your model from the "Model Level" combo. It will populate all the dyna fields in "Name" combo.

  4. Select your DynaField from the "Name" combo.

  5. Select the model to be used to Scope this DynaField definition

  6. Click the "Add Component" button on the grid. It will open new window where you can add follwing component information:

    images/download/attachments/144835186/add_component-version-1-modificationdate-1645042919000-api-v2.jpg



    • Name of the component. This is a pure alpha-numeric identifier for internal purposes – no spaces or special chars allowed.

    • Label used in the absence of a resource bundle value for key modellevel.dynafieldname.componentName

    • Type of the component. The following types are supported: - String - Integer - Float - Date - Enumeration

    • Required This is applied only when the DynaField has a value - in other words, if the DynaField itself is optional, and no value is associated to it at all, then requiredness is irrelevant. But if the DynaField is required, or if it's optional and the user wants to assign any component values, then this requiredness is honored.


    Type-specific properties:

    • String

      • Validator - a regular expression used to validate the string. For example [a-zA-Z]{3} for a 3-char alpha code.

      • Validator Explanation - used in the absence of a resource bundle value for key modellevel.dynafieldname.componentName.validatorExplanation. Used to explain to end-users the validation rule, since showing them a regex won't be very useful. For example: "Please enter a 3-character alphabetical code".

    • Integer, Float

      • Validator – a PlatformEL expression that returns true or false to indicate whether the value is valid or not.

      • Validator Explanation - similar to the String type

      • Format - a java NumberFormat pattern for formatting the value. Allows for rounding and padding. For example #0.00#

    • Date

      • Format - a java SimpleDateFormat for formatting the date. For example "yyyy-MM-dd".

    • Enumeration

      • Enumeration Values - the user must specify what enumeration values are allowed for the enum. The user will be given a list of all enumeration types (from enumeration table) to chose from. They can also create their own new enumeration, specifying all the allowed values. These will work like regular intrinsic enums in the sense that values are internationalized based on pattern availability.

  7. Define a display pattern. This tells the system how to display the DynaField textually as a single value in a form or table. An example might be ${Type}${Account}-${Department}. This will automatically use the Format of the individual components where relevant.

  8. Click Save button once you finish with adding components.