Yeah, Binding tags don’t work inside
repeaters. You’ll need to use AS to do this one, sorry. We’re looking
into better 2-way binding support in a future version of Flex.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Sean McKibben
Sent: Wednesday, August 03, 2005
4:43 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
Reverse-binding repeater items
So, I attempted the following:
<mx:Repeater id="PrerequisitesRepeater"
dataProvider="{ModelLocator.curCourse.prerequisites}">
<mx:HBox width="100%">
<mx:TextInput id="Prerequisite" editable="true"
width="300"
text="{ModelLocator.curCourse.prerequisites
[PrerequisitesRepeater.currentIndex].text}"/>
<mx:Binding source="Prerequisite"
destination="ModelLocator.curCourse.prerequisites
[PrerequisitesRepeater.currentIndex].text"/>
<mx:Link label="Delete" click=""/>
</mx:HBox>
</mx:Repeater>
It works if I don't use the mx:Binding _expression_,
if I do use it,
the first item doesn't work so good, but
successive items seem to work.
I'm guessing this falls into the category of
binding to dynamically
generated elements.
What is the 'right' way to do this? Should I just
use a viewHelper to
handle each Prerequisite's change event to update
the model?
Sometimes it seems easier to just do everything in
actionscript...
but that is just because mxml is still pretty
foreign to me...
Sean
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
|