Confirmation window in flex

Every application need confirmation window to confirm the user that they really want the task to complete.

In Flex , you can use Alert class to achieve the result. Alert class can also be used to show some simple message to the user. Here is the example how to ask user for confirmation and only do the action if he clicks YES.

import mx.controls.Alert;

private function DeleteItem(evt:MouseEvent):void

            {

             Alert.show("Do you want to delete item?","Confirm delete",Alert.YES|Alert.NO,null,deleteHandler,null,Alert.NO);

            }

 private function deleteHandler(evt:CloseEvent)

            {

             if(evt.detail== Alert.YES)

             {

             //You delete command here

             }

            }
, ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share to Facebook Share to Twitter Stumble It Share on Tumblr Digg More...