1 Reply Latest reply on Oct 20, 2006 7:51 PM by KomputerMan.com

    Selecting View States and TabNavigator Canvases

    KomputerMan.com Level 1
      Hello all Flex fans...
      I have two questions for somebody who has done this before. It will take a bit of explaining so bear with me.

      I have a datagrid called "selClaimant" as the starting point of my application. When I select something from the selClaimant datagrid I change view states to a view called "ClaimView". In the ClaimView state I have a TabNavigator control with several canvases called "Claimant" and "Claims" and several others.

      My first question is when I select something from the selClaimant datagrid how do I ensure that the Claimant canvas is displayed in the TabNavigator and not the Claims canvas???

      My second question is similar to the first but with a twist. First off the Claims canvas also has two view states (call them "ViewOne" and "ViewMany"). ViewOne has a datagrid control called selClaim that allows me to select a claim that has been filed by the claimant. ViewMany allows me to see all the details about the selected claim. When I select a claimant from the selClaimant datagrid I query the database to see how many claims that the selected claimant has filed. If there has only been one claim filed I want the starting state to be the ViewMany canvas when the user clicks on the Claims TabNavigator. If there is more than one claim in the database then I want the ViewOne to be displayed so I can select which claim I want the detail on.

      I store the number of claims in an array so I can use the array length to see if I have one or more claims but I am not sure how to logically force my view state and canvas state.

      Thanks in advance to the guru that helps me with this one!!!

      Have an Ordinary Day...
      KomputerMan ~|:-)
        • 1. Re: Selecting View States and TabNavigator Canvases
          KomputerMan.com Level 1
          Question one is answered... put this into the action script that handles the datagrid selected event.

          claimantTabNav.selectedIndex = 0;

          claimantTabNavigator is the ID of the tabnavigator whose canvas I want selected. 0 is the first tab in the navigator. Good thing I grew up on UNIX and can still remember how to count starting with a 0 instead of a 1. :)

          Have an Ordinary Day...
          KomputerMan ~|:-)