It seems that Form id can't be dynamic, so I dropped the form id & the
Accordion is drawn correctly with the panes taking input from myArray.

If I added one more element to myArray, I expected the Accordion be
updated automatically  but that  doesn't happen. Why ?

How do I redraw the  accordion once myArray is updated ?

Here is the code,

<mx:Script>
<![CDATA[

[Bindable]
public var myArray:Array=["A","B","C","D"];
private function updateArray():void
{
             myAC.source.push("E");
}
]]>
</mx:Script>

<mx:Accordion id="accordion" x="139" y="303" width="200" height="200">
             <mx:Repeater id="myrep" dataProvider="{myAC}">
                 <mx:Form label="{myrep.currentItem}">
                 </mx:Form>
             </mx:Repeater>
  </mx:Accordion>
  <mx:Button x="426" y="404" label="UpdateArray" id="update"
click="updateArray()"/>


Thanks,
Aejaz

--- In [email protected], "aejaz_98" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have the following code,
>
> <mx:Script>
> <![CDATA[
> [Bindable]
> public var myArray:Array=["A","B","C","D"];
> ]]>
> </mx:Script>
>
> <mx:ArrayCollection id="myAC" source="{myArray}"/>
>
> <mx:Accordion x="139" y="303" width="200" height="200">
>              <mx:Repeater id="myrep" dataProvider="{myAC}">
>                  <mx:Form id="{myrep.currentItem}"
> label="{myrep.currentItem}"/>
>              </mx:Repeater>
>   </mx:Accordion>
>
> The error I get while building is,   '{myrep.currentItem}' is not a
> valid identifier.   Is this not allowed in this case ?
>
> What I want to do eventually is to get the contents of the array from
a
> back end database & then use them to show the panes of the Accordion.
Is
> there an alternative way to achieve this ?
>
> Thanks,
> Aejaz
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
You can search right from your browser? It's easy and it's free.  See how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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