Is it possible to send parameters to a closeHandler Alert function? The fisrt parameter the function gets is the CloseEvent, but how to send another one?
<s:Button id="btnLoadLocalData" label="Load data"
click="Alert.show('Populate list with local data?', '', Alert.YES | Alert.CANCEL, this, loadLocalData(???parameters???), null, Alert.OK);"/>
Thank you!
An approach might be to create the closeHandler in the scope of the alert creation.
Here's an example:
I usually use an anonymous function to wrap a function call with parameters:
This should be possible using Flex's dynamic function construction. A similar question was asked here.
Here's an example:
The parameters and handler:
Your component:
My typical method of handling this use case is to add the data to the Alert form. For example
And then in the close handler for the Alert