It'll never work. When you're declaring the ViewStack inside your
declaration of the LinkBar it becomes a *property* of the LinkBar, but it's
not a *child* (in the display-hierarchy-sense) of anything.

<mx:Component> simply creates a new class (and a matching IFactory IIRC), so
that unfortunately won't help in this case either. It's for when you want to
make a lot of instances of something without the bother of a new MXML file.

-Josh

On Thu, Nov 6, 2008 at 2:06 PM, sunild999999 <[EMAIL PROTECTED]> wrote:

> 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>
> > >
> >
>
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk

Reply via email to