As a property change event for a text input label something like -
if event.propertyName == 'text':
if system.gui.confirm("Are you sure you want to change this?"):
event.source.text = event.newValue
else:
event.source.text = event.oldValue
As long as Defer Updates is true on the text label this should work fine and will run when the user hits enter/exits the text label. If the person says yes they are sure then the event.source.text will be assigned the new value, otherwise it will revert.
This method will not work nicely if Defer Updates is false, it will run every time a new character is entered.
but another member told me (( propertyChange events happen after the property has already changed. You could add a custom property with the ‘real’ value, that you only write from scripting after your write has been attempted from the text component itself.))
As I understand it with text inputs, if defer updates are on, when the user signifies they are done typing, then the property change runs. So yes it will stay as the new text person wrote unless they decline the confirmation message, hence the need to revert with else: event.source.text = event.oldValue.
Another idea:
Leave the text inputs disabled. Put a button on the side. Have the button call system.gui.inputBox to get the users desired new text, use system.gui.confirm to get confirmation, and from there write the text from your inputBox to the text label or whatever component. Never let the person write directly into the text input box if you are concerned about property changes.
Yes, bind your tag to a custom property, then uni-directionally bind the editable property from the custom property. I usually also style the input component so it is obvious when the two properties are different. Use a separate “save” button to finish the write. This approach also allows the operator to make multiple changes that get applied together.
You would have to build it yourself. Those features are only on those components. Or follow the design pattern laid out - using a Write button to do your confirmation window and write logic.