Issue Description
When using a TabGroup within a NavigationWindow, the RightNavButton of any Window within the TabGroup do not appear in the navigation bar.
Steps to Replicate
-Create a new titanium alloy project
-Open the app folder
-Replace the index.xml file inside views folder and the index.js file inside controllers
-Add the tabs.xml in in the views folder with the test-case code
-Add the tabs.js in in the controllers folder with the test-case code
-Build and run
-Click open window
-The RightNavButton is not showed
Test Case
//index.xml
<Alloy>
<NavigationWindow id="nav">
<Window id="win" backgroundColor="#fff">
<Button onClick="open">Open Window</Button>
</Window>
</NavigationWindow>
</Alloy>
//index.js
$.nav.open();
function open(){
var view = Alloy.createController("tabs").getView();
$.nav.openWindow(view);
}
//tabs.xml
<Alloy>
<TabGroup id="tabGroup" navBarHidden=false>
<Tab title="one">
<Window backgroundColor="#fff">
<RightNavButton id="rightButtons">
<Button title="push"></Button>
</RightNavButton>
<Label>Hello 1</Label>
</Window>
</Tab>
<Tab title="two">
<Window backgroundColor="#fff">
<Label>Hello 2</Label>
</Window>
</Tab>
</TabGroup>
</Alloy>
//tabs.js
var args = arguments[0] || {};
Do we know if this is a regression? Does it work in 4.X or 3.X?
Is this valid? I don't think we support tabGroup INSIDE a NavWindow. the other way around is more accurate.
In combing through community posts, it appears that a [NavigationWindow inside of a TabGroup is discouraged](https://developer.appcelerator.com/question/175579/tackle-navigation-window-in-tab-group-alloy). Regardless, I'm currently writing an app for a victim services client and at several points through the app, 2 categories of data need to be presented. So the tab groups are not used for navigation but are rather used for presenting 2 different kinds of data within a NavigationWindow. Here's [a link](https://drive.google.com/folderview?id=0ByfmzLGVZbiNWm1hWHAyVUs3N3c&usp=sharing) to a few images showing this interaction. In the first screen shot, there's a TabView that shows 2 tabs: General & Crime. General lists "general" areas of help (e.g., health, family, unemployment, etc.), and the Crime tab lists specific areas of help related to a crime. Clicking on _Domestic Violence_ leads to a new tab group with 2 tabs: "Nearby" and "Quick Call". "Nearby" shows a list of domestic violence resources while "Quick Call" shows a list of resources with crisis numbers/hotlines. Clicking on a resource in the "Nearby" table opens a new Window object with details about that resource. At each point in the app, I must include (at least) 2 buttons in the upper right-hand corner. However, in cases where the NavigationWindow is opening a TabGroup, it seems that the navigation controller of the NavigationWindow is hiding the navigation controller of the TabGroup. Unfortunately, I have not found a workaround for this issue. Although _NavigationWindow_ has a
rightNavButtons
property, setting that property does not make the _rightNavButtons_ visible. In other words, in index.js, adding the following code has no effect on the navigation bar; no "test" button appears:So the question is, is there a way that I can make the RightNavButtons visible when a NavigationWindow opens a TabGroup? Or do I need to abandon the TabGroup in my iOS implementation and write my own TabGroup implementation that does not have a navigation controller attached to it?
[~bachmakm], what you are trying to accomplish is not possible. Both the
NavigationWindow
and theTabGroup
are supposed to be top level controllers. What that means is that they are not meant to hold other controllers in them. What you need to do, instead, is to create your own "TabGroup" using views and buttons. Something like this:The same can be done with Alloy
Closing as invalid. NavigationWindows inside TabGroups, or viceversa, is not supported and highly discouraged
Thanks [~penrique] !.
Thank you for the help, @[~penrique]. I was hoping I'd be able to utilize the default TabGroup object, but I understand the issue. I will try the foundation you laid out and hope for the best! :) Thanks again!
Closing ticket as invalid with reference to the above comments.