• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic