0 Replies Latest reply on Dec 11, 2007 2:03 PM by Chris Brind

    custom dataprovider on viewstack not working

    Chris Brind
      Hi,

      I have a custom dataprovider which extends ArrayCollection and wraps a ViewStack adding only the items from the ViewStack that I want to actually be available on my LinkBar. I've done this so I can filter the LinkBar based on the user's role.

      However, I get the following error:
      Error: ERROR: The dataProvider of 'LinkBar '_ProductManager_LinkBar1'' must be String, ViewStack, Array, or IList.

      The only code that's really relevant is:
      <components:RoleBasedViewStackController id="roleBasedDataProvider" viewStack="{viewStack}" roles="{model.user.roles}"/>
      <mx:LinkBar x="10" y="36" width="100%" dataProvider="{roleBasedDataProvider}"/>

      If I do this instead:
      <mx:LinkBar x="10" y="36" width="100%" dataProvider="roleBasedDataProvider"/>

      Then it says I need to specify a ViewStack - so I'm a little confused, which is correct and if the first one is correct then why does my custom dataprovider not work?

      Thanks in advance.

      Cheers,
      Chris