What I would do in this case is use 2 Models.
 
<mx:Model id="sourceModel">
 <data>Test data</data>
</mx:Model>
 
<mx:Model id="destinationModel">
 <data>{mytext.text}</data>
</mx:Model>
 
<mx:TextInput id="mytext" text="{sourceModel.data}" />

It really would cause allot of pain for people if they had implemented automated 2 way binding.

 
The destination is what you would validate on and use to update the originating data source. You set the source data in AS based on your selected item. The only problem with this is the model is compiled into the app, so if you update it you have to recompile your app. I use a helper class that loads an xml data structure at runtime creates a copy for source and on for destination and provides bindable getters and setters for each.  This way I can extend the data model with out recompile, though; that’s another whole discussion.
 
hope this helps
 
jason
 
-----Message d'origine-----
De : [email protected] [mailto:[EMAIL PROTECTED]De la part de pepe_perez_perez_perez
Envoyé : mardi 4 avril 2006 13:22
À : [email protected]
Objet : [flexcoders] Form dataProvider

Hi,

I'd like to write this with a Form:

<mx:Form id="bookDetails" label="Book Details"
      dataProvider="{bookDataGrid.selectedItem}">
  <mx:FormItem label="Title">
    <mx:TextInput id="title" dataField="title"/>
  </mx:FormItem>
</mx:Form>

which is the same that I can write for a DataGrid but for only one
object. I'd also want that the binding be bidirectional: when I modify
something in the Form, I'd want that the object be modified.

I know it is not posible at present. But how close can I get
generallicaly? (without specifying for each field the object property
it has to update, etc.). Somehow, I feel that is very declarative for
a DataGrid but very programatic for a Form.

Thanks,

Pepe.





--
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




Reply via email to