Hi,

I'm currently working on the Alert dialog for FlexJS. Alex and I have been 
discussing options regarding event handling from the Alert dialog which could 
provide a pattern for future dialogs. We thought it would been good to get some 
opinions.

In Flex you normally post an Alert dialog using Alert.show() and pass it a 
closeFunction. The returned Alert instance can be used to listen for events for 
whatever else you want to do with it. The closeFunction is optional as you can 
also listen for events.

We thought of these possibilities:

Events: make the FlexJS Alert work the same - create an Alert instance and then 
listen for events.

Delegate pattern: register an object (probably the instance that is posting the 
Alert) as a delegate and implement one or more callbacks. This is how you would 
do it in iOS, for example.

Declare in MXML, something like this:

<fx:Declarations>
<basic:Alert id="foo" title="Panic" message="Yowza!" ok="doSomething()" 
cancel="doSomethingElse()" />
</fx:Declarations>

These are not mutually exclusive by any means.

Thoughts? Preferences?

Peter Ent
Flex SDK Team
Adobe Systems

Reply via email to