Binding is not automatically two-way. You’ll
need to bind the empModel properties back from the TextInputs as well.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Doodi, Hari - BLS CTR
Sent: Friday, May 13, 2005 7:35 AM
To: 'flexcoders@yahoogroups.com'
Subject: [flexcoders] updating
model.
Hi,
Is it possible to update the model declared using
<mx:Model> tag as soon as
user changes a corresponding form element?
For example: I have a following model
<mx:Model id="empModel">
< empID/>
< empName/>
<
empAddress/>
< empCity/>
< empState/>
<
empZipCode/>
</mx:Model>
I do have corresponding form elements like this
for all the model
attributes.
<mx:FormItem label="Address:">
<mx:TextInput
id="address" text="{ empModel.empAddress}"
width="120" height="20"
change="dataChanged=true"/>
</mx:FormItem>
Now what I am trying to do is save the changes
made by the user by passing
the entire model instead of getting individual
controls text attribute and
assign them to AS VO object. I am able to pass the
model but found old
values instead of modified values. I want to
update the model with new
values entered by the user and then send the model
to the POJO. How to do
this - updating model with latest values from form
elements text.
Thanks!
Hari
Yahoo! Groups Links
|