# Dynamic Control Properties

> Source: https://manual.pvxplus.com/data-dictionary/data-classes/dynamic

As end users' priorities and requirements change, having the ability to quickly modify control properties or create new ones is crucial. To simplify panel design and streamline control definitions, PxPlus 2018 introduces the capability to create ***dynamic control properties***. When combined with ***data classes***, dynamic control properties are ideally suited for data elements with similar properties in an application (i.e. dates, numeric codes, descriptions or lists of values).

By using ***dynamic control properties***, changes to existing panels and controls are minimized since only the data class needs to be changed. At run time, dynamic control properties are evaluated and ***automatically*** populated with values based on what is defined in the data class.

When a data class is entered for the control, information from the data class is loaded into the control's properties. If the data class is ***dynamic***, the dynamic control properties are ***automatically*** set to *Dynamic* initially and assigned a **%NOMADS'class'** variable that corresponds to a data class field (i.e. **%NOMADS'class'length**). ***Dynamic*** data classes are created by selecting the *Dynamic* check box in **[Data Class Definitions](https://manual.pvxplus.com/data-dictionary/data-classes/overview#Mark1)** maintenance.

Control properties designated as ***dynamic*** can be *manually* switched to dynamic or non-dynamic. A control can have a combination of dynamic ***and*** non-dynamic control properties ***only*** when a data class is entered.

See **[How to Use Dynamic Control Properties](https://manual.pvxplus.com/how-to/how-to-use-dynamic-control-properties)**.

Dynamic control properties are available for Multi-Lines, Drop Boxes, List Boxes and Check Boxes.

When working with Grids in the NOMADS Panel Designer, a data class can be assigned in **[Grid Presets Definition](https://manual.pvxplus.com/nomads-graphical-application/creating-panel-controls/grid-control/presets-definition#dataclasses)** by selecting the *Class* property.

For a list of the dynamic control properties for each of these control types, see **[Dynamic Control Properties](https://manual.pvxplus.com/data-dictionary/data-classes/dynamic#dynamic)**.

Note:  
Dynamic control properties are supported in NOMADS *and* iNomads environments.

## Extended Class Validation

Extended Validation is used to provide additional table validation and allow access to data elements for creating ***display-only*** Multi-Line controls when designing NOMADS panels.

See **[Extended Class Validation](https://manual.pvxplus.com/data-dictionary/data-classes/extended-validation)** for information on defining ***Extended Validation*** for **[Multi-Line Data Classes](https://manual.pvxplus.com/data-dictionary/data-classes/multiline#extvalidation)** that can be assigned to Multi-Line and Grid controls.

*(Extended Validation for Multi-Line Data Classes was added in PxPlus 2019.)*

## Populate Drop Boxes and List Boxes from a Data Source

When creating data classes for **[Drop Boxes](https://manual.pvxplus.com/data-dictionary/data-classes/dropbox#display)** and **[List Boxes](https://manual.pvxplus.com/data-dictionary/data-classes/listbox#display)**, a *Load From File* check box (on **Display** tab) can be selected, which allows a data table/file to be defined as the source when populating a drop box or list box at run time.

See **[Populate from Data Source](https://manual.pvxplus.com/data-dictionary/data-classes/populate-from-data-source)** for information on defining the ***Load From File*** functionality for Drop Box and List Box data classes, which can also be assigned to Grid controls.

*(The Load From File functionality was added in PxPlus 2019.)*

## Examples - Dynamic Data Classes

The examples below show how to create, apply and use dynamic data classes, as well as how to manually set dynamic properties:

|  |  |  |
| --- | --- | --- |
|  | **[Example 1](https://manual.pvxplus.com/data-dictionary/data-classes/dynamic#Example1):** | ***Creating and Applying a Dynamic Data Class*** |
|  | **[Example 2](https://manual.pvxplus.com/data-dictionary/data-classes/dynamic#Example2):** | ***Manually Setting Dynamic Properties*** |
|  | **[Example 3](https://manual.pvxplus.com/data-dictionary/data-classes/dynamic#Example3):** | ***Using Dynamic Data Classes*** |
|  | **[Example 4](https://manual.pvxplus.com/data-dictionary/data-classes/dynamic#Example4):** | ***Applying a Dynamic Data Class Using Property Sheets*** |

***Example 1*: *Creating and Applying a Dynamic Data Class***

This example shows that the ***dynamic*** data class, NAME, is created for a Multi-Line control type in **Data Class Definitions** maintenance. The *Dynamic* check box is selected, which defines this as a dynamic data class.

The NAME data class is applied to the CUSTOMER_NAME Multi-Line control. Information from the NAME data class is loaded into the control's properties. The *Dynamic Class* check box indicates that the selected data class is dynamic. Dynamic control properties are automatically set to *Dynamic* initially and assigned a **%NOMADS'class'** variable.

|  |  |  |  |
| --- | --- | --- | --- |
|  | ![](https://manual.pvxplus.com/migration-assets/713743e1a3e93ac04dad030a7b075b5510cc22e13f6ad9e4acd3cd4cc76adf1a.png)  <br>***\* Indicates properties that can be Dynamic*** | ![](https://manual.pvxplus.com/migration-assets/80ac28a8769065da1d6b641d172907232ee136f58b7bb5187b069a32248f8eeb.png) | ![](https://manual.pvxplus.com/migration-assets/ebef139d65e393ef1d04a7af0f49dac102314a59d1596985dad72108af9b25f5.png)  <br>***Dynamic control properties automatically set to "Dynamic"*** |

***Example 2*: *Manually Setting Dynamic Properties***

When a data class that is ***not*** dynamic is entered for a control, dynamic control properties (i.e. *Initial Value, Input Length, Input Format*) can be ***manually*** set to *Dynamic*.

In this example, the NAME data class is ***not*** dynamic, as indicated by the *Dynamic* check box, which is ***not*** selected.

When the NAME data class is applied to the CUSTOMER_NAME multi-line control, information from the NAME data class is loaded into the control's properties.

Because NAME is ***not*** a dynamic data class, the dynamic control properties are ***not*** automatically set to *Dynamic*, but they can be ***manually*** set. This is indicated by the *Dynamic* option in the *Initial Value* drop box in the screenshot below.

|  |  |  |  |
| --- | --- | --- | --- |
|  | ![](https://manual.pvxplus.com/migration-assets/4a47f69eb6827b22434c9e922eb88bee2906f3143054b15b771ecdf952972ec3.png)  <br>***Data class not Dynamic*** | ![](https://manual.pvxplus.com/migration-assets/80ac28a8769065da1d6b641d172907232ee136f58b7bb5187b069a32248f8eeb.png) | ![](https://manual.pvxplus.com/migration-assets/8b3eac211ddfe4e4dbf77807032026248e2c3c546197811f66217fcd1ba81dd1.png)  <br>***Dynamic control properties can be manually set to "Dynamic"*** |

***Example 3*: *Using Dynamic Data Classes***

For this example, suppose your application contains a drop box control named CREDIT_CARD, which is used for selecting a credit card type. This control exists in multiple panels throughout your application. Creating a ***dynamic data class*** will make subsequent changes to this drop box significantly easier.

To begin, create a ***dynamic*** data class for a drop box control. Enter CREDIT for the *Class Name*, along with the following **List Values**: *American Express*, *MasterCard* and *Visa*.

Next, apply the CREDIT data class to the CREDIT_CARD drop box control. Information from the CREDIT data class is loaded into the control's properties. Dynamic control properties are automatically set to *Dynamic* initially and assigned a **%NOMADS'class'** variable. In this example, **List Values** is set to *Dynamic* and assigned a **%NOMADS'class'values$** variable.

|  |  |  |  |
| --- | --- | --- | --- |
|  | ![](https://manual.pvxplus.com/migration-assets/a2ad793cff9b52051bed6b1b38704e89d14cab002bb65589a847ed7a6a181c2b.png)  <br>***Dynamic data class "CREDIT" created*** | ![](https://manual.pvxplus.com/migration-assets/80ac28a8769065da1d6b641d172907232ee136f58b7bb5187b069a32248f8eeb.png) | ![](https://manual.pvxplus.com/migration-assets/212620ed4b736c14df79339a85ff5e868f97a1b0083c424f4648e79a3085c331.png)  <br>***Dynamic data class "CREDIT" applied to the drop box control*** |

At run time, the CREDIT_CARD drop box is automatically populated with the **List Values** entered for the CREDIT data class.

|  |  |
| --- | --- |
|  | ![](https://manual.pvxplus.com/migration-assets/d87538bcf10ddc4a1e9d41cc3285f6e71c58e2d634380487c52700c84ef30a90.png)  <br>***Dynamic drop box at run time*** |

Now, suppose that the end user requests the addition of two more selections to this drop box: *CitiBank* and *Discover*.

To do this requires ***one change*** - adding the two selections to the **List Values** for the CREDIT data class. No other panels need to be changed.

At run time, because the **List Values** property is ***dynamic***, this drop box is automatically populated with the two additional selections entered for the CREDIT data class.

|  |  |  |  |
| --- | --- | --- | --- |
|  | ![](https://manual.pvxplus.com/migration-assets/ee003f2d6cfb79a25dee9b25cef3660c54c26c83202eb3ddf012fdede56b64b6.png)  <br>***List Values modified in the Dynamic data class "CREDIT"*** | ![](https://manual.pvxplus.com/migration-assets/5714a36801ca5b378eaf1ba0972f5de4640ce2ea3925e47840bfc84a0ce4faf5.png) | ![](https://manual.pvxplus.com/migration-assets/ebfea024c37879d0edeb4a2a5d36d7fcc47dd546f09dca5dc9cb516735914042.png)  <br>***Dynamic drop box at run time*** |

***Example 4*: *Applying a Dynamic Data Class Using Property Sheets***

The example below shows the ***dynamic*** data class NAME applied to the *Customer_Name* Multi-Line control using **[Property Sheets](https://manual.pvxplus.com/nomads-graphical-application/panel-designer/properties-table/overview)**.

|  |  |  |
| --- | --- | --- |
| ![](https://manual.pvxplus.com/migration-assets/01ea3afbfa5949b217e39c4cb20b00ed84d9df632630511b412a00254f2b10b7.jpg)  <br>***Dynamic control properties automatically set with Expression*** | ![](https://manual.pvxplus.com/migration-assets/5714a36801ca5b378eaf1ba0972f5de4640ce2ea3925e47840bfc84a0ce4faf5.png) | ![](https://manual.pvxplus.com/migration-assets/e839c8c12778b413d668b141fefe2bca5ced99b3baecaff617bc6aeed4ebd933.png)  <br> ***Assign Data Class dialog*** |

## Dynamic Control Properties

The table below lists the ***dynamic control properties*** for Multi-Lines, Drop Boxes, List Boxes and Check Boxes.

|  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| **Control Type** | **Name of Folder Tab** |  |  |  |  |  |  |
|  | **Display** | **Font/Color** | **Attributes** | **Values** | **User Aid** | **Validation** | **Query** |
| **Multi-Line** | Initial Value  <br>Input Length  <br>Empty Value  <br>Input Format | Visual Class  <br>iNomads Class | User-Defined Tag Field | N/A | Help Reference  <br>Floating Tip  <br>Message Bar | Data Validation/Display Logic | Query Type |
| **Drop Box** | List Values  <br>Input Length | Visual Class  <br>iNomads Class | User Tag Field | Default Setting  <br>Translation | Help Reference  <br>Floating Tip  <br>Message Bar | N/A | Query Type |
| **List Box** | List Values  <br>Input Length | Visual Class  <br>iNomads Class | User Tag Field  <br>Format button  <br>States button | Default Setting  <br>Translation | Help Reference  <br>Floating Tip  <br>Message Bar | N/A | Query Type |
| **Check Box** | Text  <br>Off State  <br>On State  <br>3rd State  <br>Image Transparency | Visual Class  <br>iNomads Class | User-Defined Tag Field | Default Setting  <br>Values | Help Reference  <br>Floating Tip  <br>Message Bar | N/A | N/A |

Note:  
Data classes can also be assigned to an entire grid or to individual cells in [Grid Presets Definition](https://manual.pvxplus.com/nomads-graphical-application/creating-panel-controls/grid-control/presets-definition#dataclasses) by selecting the Class property.

*(Tree View States were added to Dynamic Data Classes in PxPlus 2019.)*
