hello guys,
I have a use case where when an alarm is triggered a pop up window appears (see image). I want the user to enter a comment in the comment box shown and select a reason for the alarm from the drop down before he can close the popup.
How do I prevent the user from closing the popup window if either the comment box has not been filled or dropdown has not been selected? would this be a script in the ‘visionwindowclosed’ section? Thanks
How is the user initiating the close of the window? With the Button?
If it is in the button then just test for your requirements in the ActionPerformed event of the button.
comment = event.source.parent.getComponent("path to comment box").text
reason = event.source.parent.getComponent("path to reason dropdown").selectedValue
if len(comment) > 0 and reason != -1:
system.nav.closeWindow("path to popup")
else:
system.gui.messageBox("You must provide a comment and reason")