Configure transitioned events to open and close a dialog box

Configure transitioned events to open and close a dialog box based on a variable value.
TIP: The following configuration example shows a
FactoryTalk Optix Application
logic based on a project variable and a switch object. Instead of the variable and switch, you can use a controller tag to trigger events from field values. For more information, see Communication drivers.
  1. Configure a dialog box that will either open or close based on a variable value.
    For more information, see Dialog box.
  2. In
    Model
    , create a Boolean variable.
    For more information, see Create a variable
  3. Configure a transitioned event for the variable to trigger when the value changes to
    1
    (
    (True)
    .
    For more information, see Configure a transitioned event.
  4. Configure a transitioned event for the variable to trigger when the value changes to
    0
    (
    False
    ).
    For more information, see Configure a transitioned event.
  5. Create a switch and link its
    Checked
    property with the variable.
    For more information, see Configure a switch.
  6. Configure the
    FactoryTalk Optix Application
    logic to open the dialog box:
    1. For
      MainWindow (type)
      , configure an external event:
      project_name
      Model
      variable
      Transitioned
      Variable transition event (type)
      .
      For more information, see Configure an external event.
    2. To the external event, add the
      Commands
      UI commands
      Open dialog window
      method and link it with the dialog.
      For more information, see Add a method to an existing event.
  7. Configure the
    FactoryTalk Optix Application
    logic to close the dialog box:
    1. For the dialog box, configure an external event:
      project_name
      Model
      variable
      Transitioned1
      Variable transition event (type)
      .
      For more information, see Configure an external event.
    2. To the external event, add the
      Close
      method exposed by the dialog box.
      For more information, see Add a method to an existing event.
The dialog opens when the variable transitions to
1
(
True
) and closes when the variable transitions to
0
(
False
).
You can download a sample project from:
TransitionedEventOpenCloseDialog.zip
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal