That is one way.

 

You can also directly update the model in a change event.

 

I prefer to call into a single update function, passing in the property
name and value, so that I can do things like compare data to toggle tool
buttons an menu options.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Luke Vanderfluit
Sent: Saturday, May 10, 2008 4:08 AM
To: [email protected]
Subject: [flexcoders] binding quandary

 

Hi.

I have a master detail setup with a list of sites in the master section 
and individual sites in the detail section.

In the detail section I have a form and I want to bind the form field 
values to the current site object.

When I click on a site object in the master component, the 'set' 
function in the details component sets the site and pulls the 
particulars for that site from the server.
I handle that server call (still in the details component) and copy the 
site values from the database into the site object.

The form fields in the details component are bound to the site object 
using '{}'.

Now when I alter the fields the changes are not reflected in the site 
object.

The fields are bound to the site object so they should change when the 
site object changes.
However when the fields are changed the changes are not reflected in the

site object and I have to manually update the fields to get this to
work.

I expected the binding to work both ways. Apparently not. Is this
correct.
Should I set binding programmatically and then set them both ways, like
so?

BindingUtils.bindProperty(siteObject, selected, checkboxField,
selected);
BindingUtils.bindProperty(checkBoxField, selected, siteObject,
selected);

Can anyone shed light on this and suggest a recommended way of doing 
what I want to achieve.
Thanks.

Kind regards.
Luke

 

Reply via email to