NX Open Programmer's Guide > Block Styler Automation > Block Styler Memory and Callbacks > Dialog Value Example
Dialog Value Example
As an example of how dialog memory and your callbacks are used to define the current dialog values, consider the following example.
Consider a dialog with two string blocks named S1 and S2. Assume the following initial assignments are made to those string blocks:
| String Block | Default Value Given in DLX File | Values Assigned by the Initialize Callback |
|---|---|---|
| S1 | "dlx s1" |
nothing — no SetString is made for S1 |
| S2 | "dlx s2" |
"initial s2" |
Now consider the following user actions:
- When the dialog is first displayed,
S1 = "dlx s1"andS2 = "initial s2". - While in create mode the user changes S1 to
"abc"and S2 to"xyz". The user hits Ok, which executes the Apply callback. - The next time the dialog is displayed in create mode,
S1 = "abc"andS2 = "xyz". - The next time the dialog is displayed in edit mode,
S1 = "dlx s1"andS2 = "initial s2". Note: the Initialize callback is really expected to query the object that is being edited and set S1 and S2 accordingly — dialog memory is NOT maintained in this example and S1 is simply set to a constant. - While in edit mode the user changes the values to
S1 = "123"andS2 = "456". The user hits Ok, which executes the Apply callback. - The next time the dialog is displayed in create mode, the dialog will display
S1 = "abc"andS2 = "xyz". Dialog memory is NOT changed when the dialog is in edit mode. In edit mode the object being edited is expected to contain the values required to initialize the dialog values. - The user hits the reset button on the dialog rail clip. The dialog will display
S1 = "dlx s1"andS2 = "initial s2".
Sequence of Callbacks
Dialog callbacks are called in the following sequence:
- Read the
.dlxfile. Instantiate the UI blocks specified in the dlx file. Apply the settings contained in the dlx file to the UI blocks. - Call the Initialize callback.
- Apply the settings stored in dialog memory to the UI blocks.
- Call the DialogShown callback.
When the dialog is shown using Edit mode, step 3 is skipped (dialog memory values are not applied in edit mode).
Related Topics
- Block Styler Memory and Callbacks
- Standard Navigator Buttons
- Dialog Memory
- Dialog Values
- Callbacks
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/genid_dialog_value_example_54_2067 · retrieved 2026-07-07