|
In HTML forms, you can set a clear or reset button that
wipes out the contents of any form fields. In Flex, the concept is a
little different. Right now, I have a flex form bound to a data model
(and back to the TextInput field as illustrated below). <mx:Model id="DataModel"> <FirstName>{ FirstName.text }</FirstName> <LastName>{ LastName.text }</LastName> <MiddleName>{ MiddleName.text }</MiddleName> </mx:Model> <mx:FormItem label="First Name"> <mx:TextInput id="FirstName" text="{ DataModel.FirstName
}" /> </mx:FormItem> I tried
creating a destroy() reset method by setting the data model to “undefined”.
This doesn’t appear to work. It populates each TextInput field with
“undefined” and seems to permanently unbind the data model from the
form. I don’t see any methods that I could use to reset these
fields under mx:Form. Is there another option I’m not thinking of,
or do I have to loop through each TextInput, ComboBox and other form fields to manually
reset their values back to default? Erich Cervantez -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS
|
- [flexcoders] Resetting a Flex Form Erich Cervantez
- Re: [flexcoders] Resetting a Flex Form Clint Modien

