1
votes

I have a problem with the default behaviour of my tabbedViewNavigatorApplication...

I have 5 tabs each with several views contained in their respective ViewNavigators... After navigating down to one of the views under these tabs, then clicking on a different tab on the tab bar then returning to the tab I was just in using the tab button I end up back in that view I was looking at. I would like each tab button at the bottom of the app to force the firstView in that stack to show..NOT the last view that was shown in that stack.

Is there a way to do this setting a selectedIndex property or something?

To clarify, below is the situation showing an example with just 2 tabs(2 ViewNavigators) which sit inside a TabbedViewNavigatorApplication :

Tab1(button)      Tab2(button)
Tab1 View 1       Tab2 View 1
Tab1 View 2       Tab2 View 2
Tab1 View 3       Tab2 View 3

When someone navigates down to Tab1 View 3 , then clicks Tab2 Button, then clicks Tab1 Button, I want Tab1 View 1 to load NOT Tab1 View 3 which was the last view shown in the Tab1 stack.

How can I override this default behaviour.

Any help would be appreciated.

Thanks

Marco

1

1 Answers

0
votes

It is quite simple. on Creation complete of tabbedViewNavigator add a listener on tab index cvhage event like this :

tabbedViewNavigator.tabBar.addEventListener(IndexChangeEvent.CHANGE,onTabChange);

And on this listener just call popToFirstView() like this :

(tabbedViewNavigator.selectedNavigator as ViewNavigator).popToFirstView();