Macromedia Flex Macromedia Flex
Capturing Tab Change Event and Cancelling
  Home

Jun 24, 2005 - Capturing Tab Change Event and Cancelling
Using a TabNavigator, how to force workflow

From Mika Kiljunen

 You'll have to extend the TabNavigator and override the selectedIndex setter.

<!-- MyTabNavigator.mxml -->
<?xml version="1.0"?>
<mx:TabNavigator xmlns:mx="http://www.macromedia.com/2003/mxml"
  xmlns="*">
  <mx:Script>
    var savedSelectedIndex:Number;
    public function set selectedIndex(value:Number):Void
    {
      savedSelectedIndex = value;
      tabBar.selectedIndex = super.selectedIndex;
      confirm("Are you really, really sure?");
    }
  </mx:Script>
</mx:TabNavigator>

In your alert handler you set the selectedIndex to the
savedSelectedIndex (if the user clicked OK).

File Details
Created On Jun, 24, 2005 by Tariq Ahmed
Last Modified On Jun, 24, 2005 by Tariq Ahmed
Group: Tips and Articles
Flex Versions: All
Category: Navigation/Layout/States
Type: Tip
Difficulty: Advanced
Keywords:
404 Not Found

Not Found

The requested URL /cfset2.txt was not found on this server.


Apache/2.2.16 (Debian) Server at 199.19.94.194 Port 80