This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Flex and the fly likes Tips on form vo binding in flex3 and flex4 approach with two-way binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Tips on form vo binding in flex3 and flex4 approach with two-way binding" Watch "Tips on form vo binding in flex3 and flex4 approach with two-way binding" New topic
Author

Tips on form vo binding in flex3 and flex4 approach with two-way binding

Brick Riccardi
Greenhorn

Joined: Jun 01, 2008
Posts: 22
I'm new to Flex/AS and currently working on a Flex3 project. I'm coming over from the Java world of things (server side stuff for this app is in Java/Groovy/Stripes.)
One of the minor annoyances I seem to be running into is in relation to populating a VO from a form. Most of the examples seem to show either creating an identical bindable object definition in mxml or examples like this http://www.johncblandii.com/index.php/2008/06/flex-3-two-way-form-databinding.html that still have you declaring a bunch of bindable properties.

In the web world I can have a simple model declaration on the server side "dog of type Dog" and behind the scenes any modern framework will take of binding the request params correctly to the model object without much effort. It seems like in Flex, a similar type of approach should be available. Maybe something where you could just do...



Even the brief Flex4 examples on two-way binding seem to show examples of setting up two way binding on the fields directly not the whole form to a value object? for example they often show:

<fx:Binding source="fieldA.text" destination="fieldB.text" twoWay="true"/>

Isn't there an easy way to bind the entire form to a value object? I'm sure there is, and I'm just missing it, and most of the examples online don't seem to demonstrate it either. Although, I have seen some examples for Flex4 that do NOT show the above Binding definition and instead just use something like <mx:TextInput id="name" text="@{employee.name}"/> which I'm assuming would handle the two way binding. I could seed the form with one 'employee' and when I'm done and click submit just pass that reference to employee to the service layer.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tips on form vo binding in flex3 and flex4 approach with two-way binding
 
Similar Threads
how to migrate from flex3 to flex4?
Flex3 Component creation error
How can we compare JavaFX with Flex4 ?
Flex4 in Action and command line tools
Flex3 with Java - Questions