How can I show a warning before changing the radio block in flex?

In my flex application, I have radio buttons. When the user clicks on the switch, I want to pop up an alert, and if the user clicks OK, the switch will change, otherwise their change will be discarded.

How to do it? I tried event.preventDefault (); when handling the click event, but it did nothing. Any other ideas?

+4
source share
3 answers
  • Listen to the change event.
  • If the new selected value is true , set it to false and show the popup
  • Update the selected value based on the result of the popup.
+3
source

You can listen to the valueCommit event and try to stop the behavior (change of value) in the event handler. There you can also create a popup ...

0
source

Listen to the MouseEvent.MOUSE_DOWN event and in your handler do the following:

 function myHandler(event:MouseEvent) : void { event.preventDefault(); event.stopImmediatePropagation(); // statements } 
0
source

All Articles