Sure, that is reasonable.

You can also loop through the children of any container like this:

                var n:Number = oContainer.numChildren;
                for (var i:Number = 0; i < n; i++)
                {
                         var cbxCur:CheckBox = oContainer.getChildAt(i);
                         sTemp += "\n" + cbxCur.selected;
                }

Or, consider updating your save data structure on the change event of
each combo.

All those ways are fine.

Tracy

-----Original Message-----
From: javawebgrrl [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 7:18 PM
To: [email protected]
Subject: [flexcoders] Re: Can you Use a Repeater without a dataprovider?



Hi,
  I wanted to use some looping mechanism so that I can process the 
combo box's in a loop in my actionscript. When the user 
clicks "save" I don't want to go have to check 4 differant combo box 
id's to see what was selected, if I create them in a loop, I can 
just loop through the results.  For example


<mx:Repeater>
    <mx:ComboBox id="cbox" dataProvider="{data)"/>
 </mx:Repeater>

Then . . . 
var results:Array = new Array();
for(i=0;i<repLength;i++){
  var sel:String = cbox[i].selectedItem;
  results.push(sel);
}


Instead of having identical code for four differant combo boxs with 
4 differant id's, that I would then have to evaluate for the 
selected Items 4 differant times.
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
> I have to ask, if they are not dynamic, what is the advantage of 
using a
> repeater?
> 
> I think you will need to create a dataProvider, even if its:
> DataProvider="{[1,2]}"
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
>       <mx:Repeater id="repeater1" count="3" dataProvider="{[1,2]}">
>               <mx:CheckBox label="test" >
>               </mx:CheckBox>
>       </mx:Repeater>
> </mx:Application>
> 
> Tracy
> 
> -----Original Message-----
> From: javawebgrrl [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 04, 2005 5:48 PM
> To: [email protected]
> Subject: [flexcoders] Can you Use a Repeater without a 
dataprovider?
> 
> 
> 
> Hi,
>   Can you use a repeater without a dataprovider, for example , if 
you 
> want to repeat an item 4 times, is there any way to say <repeater 
> count=4> ?
>   I want to put identical combo box's on a page, and plan to use a 
> repeater. I know I want to repeat the combo box 4 times, and only 
need 
> one dataprovider to use each time for the combo box population. Is 
> there another flex tag I should use for this type of operation?
> This is what I want to do:
> 
> <mx:Repeater count=4>
>    <mx:ComboBox id="cb1" dataProvider="{data)"/>
> </mx:Repeater>
> 
> Thanks for any advice !
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links





 
Yahoo! Groups Links



 







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to