Flex: Is it possible to hide some tabs in tab navigator and show them only when certain event occurs
I am using tab navigator. And it has thee tabs "Search", "Show as text", "Show on map"
I have a addres开发者_开发百科s search box in Search tab. I would like to hide other two tabs if search has not happened yet. So if user hasn't searched any thing other two tabs shouldn't be visible.
Can you please tell me how can I achieve this?
Hiding tabs is a preferred way. Second option is to disable tabs until search is done.
There are a couple ways to do this.
Use the TabNavigator's getTabAt() method which returns the Button that makes up the visual tab and set the visible property to false. It can be tricky with bindings.
The other option is to addChildAt or removeChildAt on the TabNavigaor depending on what tabs you want to show or hide.
As you mention disabling could also work. Do this by as well setting the tab's container to disabled.
I had used removeChildAt on tab navigator and works fine. But if you want to do specific actions on selected Tab then you should think about other solution because the removedChild is no longer available in tab navigator.
精彩评论