1 Reply Latest reply on Nov 4, 2011 11:44 AM by Flex harUI

    ViewStack container. choose view based on variable.

    xandout

      Hi I am trying to implement Role based access control in my application.  I have settled on a login screen which will compare users and passwords to a MySQL DB.  upon a match I need to read the "role" associated with each user.  With the role I want to have differnt views for each role i.e. Admin role will see an admin view and users a user view and so on. 

       

      I have been successful using a button to change the view.selectedChild.  how can I use view.selectedChild=$var.

       

      As a test I have used a dataGrid to give me choices.  But when I use the selectionChange handler like this

       

       

      protected function dataGrid_selectionChangeHandler(event:GridSelectionEvent):void
                                    {
                                              view.selectedChild = dataGrid.selectedItem.role;
                                    }
      

       

       

      it does not change the view.

       

      Is there a way to use ViewStack for access control in this manner?