Another way is to use two binding tags
<mx:Binding source="{nameTextInput.text}" destination=" vo.name" />
<mx:Binding source="{vo.name}" destination="nameTextInput.text " />
<mx:TextInput id="nameTextInput" />
yet another is
<mx:TextInput id="nameTextInput" text="{ vo.name}" change="vo.name =nameTextInput.text" />
which is best? you like swiss or cheddar?
DK
On 7/14/06, Clint Modien <[EMAIL PROTECTED]> wrote:
It works like this...
// ------- myVO.as -----------
package {
public class myVO {
public var name:String;
public var phone:String;
}
// ------ SampleForm.mxml ---------
<mx:Script>
<![CDATA[
public var vo:myVO;
]]>
</mx:Script>
<mx:Form>
<mx:FormItem label="Name">
<mx:TextInput id="nameTextInput" text="{ vo.name}" />
</mx:FormItem>
<mx:FormItem label="Phone">
<mx:TextInput id="phoneTextInput" text="{vo.phone}" />
</mx:FormItem>
</mx:Form>
// --------- here's how to create two way binding ------------
<mx:Binding source="nameTextInput.text" destination=" vo.name" />
<mx:Binding source="phoneTextInput.text" desitnation="vo.phone" />On 7/14/06, jrjazzman23 < [EMAIL PROTECTED]> wrote:I find myself wanting to do bidirectional binding, but I have the
feeling there may be some drawbacks to this.
I want a screen's controls to be initialized (bound to) a data model.
As the user changes the controls' values, I want the data model to
reflect this. In this case the data model is basically a VO. Is
there a best practice for this?
thanks
Jeremy
--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it? __._,_.___
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

