Thanks a lot

Rajesh J

--- In flexcoders@yahoogroups.com, "Abdul Qabiz" <[EMAIL PROTECTED]> wrote:
> Yup, you can do that.
> 
> 
> Two out of many ways:
> 
> 1)
> 
> 
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
>     <mx:Script>
>         var dp:Array = ["1", "2", "3"];
>     </mx:Script>
>     
>     <mx:Accordion id="accordion" width="50%" height="50%">
>               <mx:Repeater  id="rp" dataProvider="{dp}">
>                       <mx:VBox label="VBox {rp.currentItem}">
>                               <mx:Button label="Button in Vbox
> {rp.currentItem}" click="alert(event.target.getRepeaterItem() + '
> pressed')"/>
>                       </mx:VBox>
>               </mx:Repeater>
>     </mx:Accordion>
> 
> </mx:Application>
> 
> 2)
> 
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
> creationComplete="createContainers()">
>       <mx:Script>
>               import mx.containers.*;
> 
>               var count:Number = 0;
>               function createContainers()
>               {
>                       count++;
>                       for(var i=0;i<5;i++)
>                       {
>                               var vbox = accordion.createSegment(VBox,
> "vbox_"+i, "Vbox " + (i+1));
>                       }
>               }
>       </mx:Script>
> 
>       <mx:Accordion id="accordion">
>       </mx:Accordion>
> </mx:Application> 
> 
> 
> 
> First approach is the recommend way. If you want to have more control
> you can use second approach, but this would require event handling and
> then adding child components to added Vboxes.
> 
> -abdul
> 
> 
>  
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Rajesh Jayabalan
> Sent: Thursday, June 30, 2005 4:28 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] dynamically create a container
> 
> Hi,
> 
>  I need to create containers (box,panel.. ) dynamically based on the
> data in DB. i.e.,
> 
> If I have 5 categories 
> I need to create 5 VBOX inside a mx:Accordion ( and populate them with
> their corresponding items)
> 
> Is this possible?
> 
> Any help will be greatly appreciated
> 
> Regards
> Rajesh J
> 
> 
> 
> 
> 
> --
> 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




--
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

<*> 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