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.- Configure a dialog box that will either open or close based on a variable value.For more information, see Dialog box.
- InModel, create a Boolean variable.For more information, see Create a variable
- Configure a transitioned event for the variable to trigger when the value changes to1((True).For more information, see Configure a transitioned event.
- Configure a transitioned event for the variable to trigger when the value changes to0(False).For more information, see Configure a transitioned event.
- Create a switch and link itsCheckedproperty with the variable.For more information, see Configure a switch.
- Configure theFactoryTalk Optix Applicationlogic to open the dialog box:
- ForMainWindow (type), configure an external event: .For more information, see Configure an external event.
- To the external event, add the method and link it with the dialog.For more information, see Add a method to an existing event.
- Configure theFactoryTalk Optix Applicationlogic to close the dialog box:
- For the dialog box, configure an external event: .For more information, see Configure an external event.
- To the external event, add theClosemethod 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.ziptransitioned event
dialog box
variable
event listener
Provide Feedback