I think you’re going to need to introduce another binding on the CheckBox, selected=”{rep_state.currentItem.selected == true}”.  I know the Model doesn’t declare a selected property, so in the beginning any currentItem.selected will return undefined, which is why the statement explicitly is looking for true.  Now when the RemoteObject call returns you will need to go through that list, find the matching item in your model, and set selected=true.  If you need to unselect you’ll need to iterate through your model and basically only set selected to true if the ID happens to be in your list.  You can probably come up with some temporary data structure that will make the search process faster.

 

HTH,

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 14, 2005 3:47 PM
To: [email protected]
Subject: [flexcoders] Repeater with Checkboxes

 

Hi All,

I have a repeater with checkboxes.

I want the checkboxes to be checked/unchecked based on
the data I receive from a RemoteObject. What I receive
from the remote object is a string with list of State
ID's like '100,400'. Now based on this list I want
check/uncheck the corresponding check boxes
programmatically.

Here's a sample code/model. Can someone explain me how
this could be done?

<mx:Model id="mdl_state">
  <node>
    <node ID="100" LABEL="CA">
    <node ID="200" LABEL="NY">
    <node ID="300" LABEL="NJ">
    <node ID="400" LABEL="KY">
    .
    .
    .
  </node>
</mx:Model>
                                    <mx:Repeater  id="rep_state"
dataProvider="{mdl_state}">
                                          <mx:CheckBox
label="{rep_state.currentItem.LABEL}"
click="fnSiteSelected(event.target);" />
                                          </mx:Repeater>
                       
Thanks,
Mohanraj

           


           
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/



Yahoo! Groups Links

Reply via email to