1 Reply Latest reply on Nov 7, 2008 7:50 PM by Newsgroup_User

    Setting a togglebuttonbar's button to not visible

    wkolcz Level 1
      I have an application that I am using a ToggleButtonBar to navigate using a ViewStack. Inside the viewstack are Canvases for each module (parts of the application). What I need to do is hide 2 of the buttons./canvases/modules based on a role assigned to a variable on login.

      If the user is an Admin, show them, if not, hide them. I was hoping setting the Canvas's visible to false how also hide the button, but apparently it doesn't

      Any one know how to hide 2 buttons (Canvases) of a ViewStack from appearing on the ToggleButtonBar?

      <mx:Canvas label="All Projects" width="100%" height="100%">
      <mods:allProjects />
      </mx:Canvas>
      <mx:Canvas id="usersLink" label="Users" width="100%" height="100%" visible="false">
      <mods:userMgr />
      </mx:Canvas>
      <mx:Canvas id="projectReports" label="Project Reports" width="100%" height="100%" visible="false">
      <mods:projReports />
      </mx:Canvas>
        • 1. Re: Setting a togglebuttonbar's button to not visible
          Level 7

          "projectproofing" <webforumsuser@macromedia.com> wrote in message
          news:gf2pdq$43t$1@forums.macromedia.com...
          >I have an application that I am using a ToggleButtonBar to navigate using a
          > ViewStack. Inside the viewstack are Canvases for each module (parts of the
          > application). What I need to do is hide 2 of the buttons./canvases/modules
          > based on a role assigned to a variable on login.
          >
          > If the user is an Admin, show them, if not, hide them. I was hoping
          > setting
          > the Canvas's visible to false how also hide the button, but apparently it
          > doesn't
          >
          > Any one know how to hide 2 buttons (Canvases) of a ViewStack from
          > appearing on
          > the ToggleButtonBar?

          Don't bind directly to the ViewStack. Instead, use something like an
          ArrayCollection that refers to it and can be filtered.

          HTH;

          Amy