I'm having lots of trouble using XML as a dataProvider for a Repeater
component (Flex 2 B3), and from what I've seen of the other posts on
the list, it appears that I'm not alone. 

I tried Doug Lowder's code below, thinking that it would help me to
see what is wrong with my code. But when I compile Doug's code and run
it, the Accordion appears as a blank white rectangle in the upper left
corner of the screen: No buttons or labels of any kind are visible. 

In my own code, my intent is to use a Repeater to display instances of
a custom component. When I could not get that to work, I tried just
getting the Repeater to display Label components with their text set
to the Repeater's currentIndex (cast to a String of course). But when
I compile it and run it, nothing is displayed where the Labels should
be. I'm not getting any compiler errors, but the app is simply blank
where the Repeater should be giving me Labels. 

I've searched around, but I can't find anything in the Flex 2.0 docs
or online that provides clear guidelines on how to use an external XML
file with a Repeater. I don't have any trouble with other components
(MenuBar, DataGrid, ComboBox, List). It's just the Repeater that I
can't seem to figure out.

Can anyone point me to a good resource for this?

-Jim

--- In [email protected], "Doug Lowder" <[EMAIL PROTECTED]> wrote:
>
> Building the accordion tabs is very easy.  You'll need some extra 
> work to create the children of the accordion; probably a custom 
> component instead of the Canvas tag used in the below example.  BTW, 
> I think I got the basis for this sample code from someone's site, 
> probably Jester's, but I couldn't find the direct link.
> 
> Data.xml:
> ---------------
> <xml>
>   <header label="my header 1" />
>   <header label="my header 2" />
>   <header label="my header 3" />
> </xml> 
> 
> app.mxml:
> ----------------
> <?xml version="1.0" encoding="utf-8"?>
> 
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; 
> width="100%" height="100%">
> 
> <mx:Model id="myXml" source="Data.xml"/>
> 
> <mx:Accordion height="300" width="200">
>     <mx:Repeater  id="rp" dataProvider="{myXml.header}">
>         <mx:Canvas height="100%" width="100%" 
> label="{rp.currentItem.label}"/>
>     </mx:Repeater>
> </mx:Accordion>
> 
> </mx:Application>
> 
> 
> Enjoy!
> Doug
> 
> 
> --- In [email protected], "alehrens" <axe130@> wrote:
> >
> > I'm a newbie to both Flex and FlexCoders...  How would you go 
> about 
> > populating an accordian tab/data from an XML file?  Specifically, 
> I 
> > have an XML file that contains a label, data and description.  I'd 
> > like to use the label as the tab of the accordian, then show the 
> data 
> > and description inside the accordian.  Is there a clean and simple 
> way 
> > to do this?
> >
>






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