Here is a quick example of how you can do
it. <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.CloseEvent; import
mx.events.CalendarLayoutChangeEvent; private var
currentSetDate:Date; private var newDateChosen:Date; private function
confirm(event:CalendarLayoutChangeEvent):void { newDateChosen =
event.newDate; Alert.show("Are you
sure you want to select " + event.newDate + "?", "Confirm
Changes", 3, this, alertClickHandler); } private function
alertClickHandler(event:CloseEvent):void { if
(event.detail==Alert.YES) {
df.selectedDate = newDateChosen;
currentSetDate = newDateChosen; } else {
df.selectedDate = currentSetDate; } } ]]> </mx:Script> <mx:DateField id="df"
change="confirm(event)" creationComplete="currentSetDate =
df.selectedDate" /> </mx:Application> Good luck. Joan From: You might be able to find another event to
capture before the commit, but it can be a bit hacky sometimes because of the
different way to interact with form inputs fire different events. The way
to do this that would ensure you get it right everytime is to store the
dateField value in a variable, and if they don't confirm the change, change the
selectedDate back to what was in the Date variable. If they do confirm, then
set the variable equal to the new selectedDate. If you are doing this in a lot of places,
then simply extend the DateField and add a new property on it called
previousDate or something like that. Then you could build the confirmation and
change back logic right into the component. Karl Cynergy Systems, Inc. From: I'd like to be able to ask the user to confirm their
date selection -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ |
- RE: [flexcoders] need to be able to cancel change to a DateF... Joan Lafferty