Hi,
 
you can add an eventListener on the TabNavigator, listening for an 
IndexChangedEvent and do all your validations...
 
And if you need to cancel the current change, you could try an 
evt.preventDefault();
 
private function changeIndex(evt:IndexChangedEvent):void
{
    evt.preventDefault(); // cancel the changing
}
 

________________________________

De: [email protected] [mailto:[EMAIL PROTECTED] Em nome de guitarguy555
Enviada em: terça-feira, 1 de abril de 2008 16:16
Para: [email protected]
Assunto: [flexcoders] TabContainer with modules - how to cancel Tab change



I have a Flex Application that has a TabNavigator. Each tab contains a 
moduleLoader that loads a corresponding Module. 

On some of these modules, I have a basic Form with Validators connected 
to it. I want to be able to make sure that the form values are valid 
before the user navigates away from the currently selected tab by 
clicking a new tab. 

In other words, I want the Validator to fire when the user clicks on a 
new tab and if there are any invalid values I want to prompt the user 
to fix them and stop the event propogation so the TabNavigator stays on 
the current tab.

How can I cancel the TabNavigator change?



 

Reply via email to