27 Mar 2012 4:42 AM #1
Binding models and forms
What is the correct way of binding a model to a form's components (i.e. a text box) ?
I want to be able to set the bindings, populate the model and then have the components show the data from the model field to which they have been bound.
I am hoping this will be a two way binding so that the change in the component is pushed back into the model. I can then validate the model when the save button is tapped.
I have looked at all of the getting started guides and they all rely on the view instantiating a specific model instance and binding that instance to the form's fields but this is not what I am able (or want) to do.
Any help or guidance appreciated.
27 Mar 2012 4:53 AM #2
you can fill a form with model data with setRecord()
27 Mar 2012 5:07 AM #3
Thanks for the reply, but that method needs a model instance to populate with. Bindings should work without the need for a specific instance to be instantiated.