Hi,
Just a guess: when you specify the dataProvider that way, maybe need to put
your view
stack inside of a <mx:Component> tag:
<mx:LinkBar >
<mx:dataProvider>
<mx:Component>
<mx:ViewStack />
</mx:Component>
</mx:dataProvider>
</mx:LinkBar>
--- In [email protected], "valdhor" <[EMAIL PROTECTED]> wrote:
>
> Hmmm....I would have expected that to work.
>
> It seems you have to specify the dataprovider property as part of the
> LinkBar...
>
> <?xml version="1.0"?>
> <!-- Simple example to demonstrate the LinkBar control. -->
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> <mx:Panel title="LinkBar Control Example" height="75%" width="75%"
> horizontalAlign="center"
> paddingTop="10" paddingBottom="10" paddingLeft="10"
> paddingRight="10">
> <mx:LinkBar color="#0000FF" fontWeight="bold"
> dataProvider="{myViewStack}"/>
> <!-- Define the ViewStack and the two child containers. -->
> <mx:ViewStack id="myViewStack" borderStyle="solid" width="100%"
> height="80%">
> <mx:Canvas id="search" backgroundColor="#FFFFCC"
> label="Search" width="100%" height="100%">
> <mx:Label text="Search Screen" color="#000000"/>
> </mx:Canvas>
> <mx:Canvas id="custInfo" backgroundColor="#CCFFFF"
> label="Customer Info" width="100%" height="100%">
> <mx:Label text="Customer Info" color="#000000"/>
> </mx:Canvas>
> <mx:Canvas id="accountInfo" backgroundColor="#FFCCFF"
> label="Account Info" width="100%" height="100%">
> <mx:Label text="Account Info" color="#000000"/>
> </mx:Canvas>
> </mx:ViewStack>
> </mx:Panel>
> </mx:Application>
> --- In [email protected], "ilikeflex" <ilikeflex@> wrote:
> >
> > Hi
> >
> > I have below sample code(Code1) which is working fine and i have
> > taken from livedocs. Now i have made modification to code1 and
> > changed to code2.
> >
> > In code2 i am declaring the dataprovider property of the linkbar in a
> > different way.I am using the <mx:dataProvider> tag.In this case
> > linkbar does not show viewstack contents.
> >
> > I have been putting my head into this but could not find any solution.
> > Any pointers are highly appreciated.
> >
> > Thanks
> > Rajan
> >
> >
> > Code1:
> > <?xml version="1.0"?>
> > <!-- Simple example to demonstrate the LinkBar control. -->
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> >
> > <mx:Panel title="LinkBar Control Example"
> > height="75%" width="75%" horizontalAlign="center"
> > paddingTop="10" paddingBottom="10" paddingLeft="10"
> > paddingRight="10">
> >
> > <mx:LinkBar color="#0000FF" fontWeight="bold"
> > dataProvider="{myViewStack}"/>
> >
> > <!-- Define the ViewStack and the two child containers. -->
> > <mx:ViewStack id="myViewStack" borderStyle="solid"
> > width="100%" height="80%">
> >
> > <mx:Canvas id="search" backgroundColor="#FFFFCC"
> > label="Search" width="100%" height="100%">
> > <mx:Label text="Search Screen" color="#000000"/>
> > </mx:Canvas>
> >
> > <mx:Canvas id="custInfo" backgroundColor="#CCFFFF"
> > label="Customer Info" width="100%" height="100%">
> > <mx:Label text="Customer Info" color="#000000"/>
> > </mx:Canvas>
> >
> > <mx:Canvas id="accountInfo" backgroundColor="#FFCCFF"
> > label="Account Info" width="100%" height="100%">
> > <mx:Label text="Account Info" color="#000000"/>
> > </mx:Canvas>
> > </mx:ViewStack>
> >
> > </mx:Panel>
> > </mx:Application>
> >
> > Code2:
> > <?xml version="1.0"?>
> > <!-- Simple example to demonstrate the LinkBar control. -->
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> >
> > <mx:Panel title="LinkBar Control Example"
> > height="75%" width="75%" horizontalAlign="center"
> > paddingTop="10" paddingBottom="10" paddingLeft="10"
> > paddingRight="10">
> >
> > <mx:LinkBar color="#0000FF" fontWeight="bold">
> > <mx:dataProvider>
> > <!-- Define the ViewStack and the two child containers. -->
> > <mx:ViewStack id="myViewStack" borderStyle="solid"
> > width="100%" height="80%">
> > <mx:Canvas id="search" backgroundColor="#FFFFCC"
> > label="Search" width="100%" height="100%">
> > <mx:Label text="Search Screen" color="#000000"/>
> > </mx:Canvas>
> >
> > <mx:Canvas id="custInfo" backgroundColor="#CCFFFF"
> > label="Customer Info" width="100%" height="100%">
> > <mx:Label text="Customer Info" color="#000000"/>
> > </mx:Canvas>
> >
> > <mx:Canvas id="accountInfo" backgroundColor="#FFCCFF"
> > label="Account Info" width="100%" height="100%">
> > <mx:Label text="Account Info" color="#000000"/>
> > </mx:Canvas>
> > </mx:ViewStack>
> > </mx:dataProvider>
> > </mx:LinkBar>
> > </mx:Panel>
> > </mx:Application>
> >
>