Dropdown confirmation not working?

Will someone double-check me on this: When a dropdown component has the comfirmation enabled, and during runtime the user selects NO in the confirmation box, the event will not change the tag or property it would have changed if the user had chosen YES…, but it does change the selectedValue and selectedString. So, the user selects NO, and correctly the event doesn’t trigger, but the list still shows the selected string and the selectedValue also changes, even though the user selected NO.

The dropdown component doesn’t have built-in confirmation. Are you doing confirmation in an event handler (script)? Are you using a different component?

We are doing it in the Event handler, on a Property change. (We specify a change in the selectedValue).

In that case the value will update regardless of whether or not the user selects yes or no. If you change the value back it will run the propertyChange script again.

Yes, we tried that too, with that exact result. How can we get it to not change if the operator selects NO on the confirmation?

What you can do is throw in a boolean variable to handle the case where the user selects “NO”, which will fire another propertyChange event since the selectedValue/selectedLabel/etc will be changed back to its original value. Try creating a script module under the app package called “test” and add this script to the module. Then you can reference it from the event handler of the dropdown with app.test.confirm(event).

[code]global flag
flag = 0

def confirm(event):
import system
global flag
if event.propertyName == “selectedLabel” and not flag:
if not system.gui.confirm(“Are you sure?”):
event.source.selectedLabel = event.oldValue
flag = 1

elif event.propertyName == "selectedLabel" and flag:
	flag = 0

[/code]

James, Thank you for the help and code. We implemented your suggestion, and it worked fantastically! Thanks again :smiley: