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


__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to