Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

TabGroup navigation & navigation through windows

$
0
0

In my project, I use actually no TabGroup navigation. I want now to use this kind of navigation.

But, for now, my App uses NavigationWindow to switch between windows, and I heard that's not recommend to use both way to navigate in the app.

I'm a bit confused with the way I should change my xml markup to match my new requirements...

Here is my INDEX.XML:

A list of cities...

<Alloy>
    <Collection src="cities"/>
    <NavigationWindow id="navGroupWin"> 
        <Window class="container">
            <!-- Add TableView and  TableViewRow -->
            <TableView dataCollection="cities">
                <TableViewRow class="cityList" title="{nom_commune}" abrv_commune="{abrv_commune}" onClick="showCity"></TableViewRow>
            </TableView>
        </Window>
    </NavigationWindow>
</Alloy>
When I click on a city in a TableViewRow, I navigate through a new window basically with this code from INDEX.JS:
var cityview = Alloy.createController("citydetails", args).getView();
 
    if (OS_IOS) {
        $.navGroupWin.openWindow(cityview);
    }
...targeting CITYDETAILS.XML:

A list of people living in the city clicked.

<Alloy>
    <Collection src="characters"/> 
    <Window class="container">
       <!-- Add TableView and  TableViewRow -->
        <TableView dataCollection="characters" dataFilter="filterFunction">
            <TableViewRow class="cityList" layout="vertical">
                <Label id="characterName" text="{nom}"></Label>
                <Label id="characterCity" text="{commune}"></Label>
            </TableViewRow>
        </TableView>
   </Window>
</Alloy>
Now, what I want to achieve is something like that in INDEX.XML:
<Alloy>
 
  <TabGroup id="tabs">
 
    <Tab title="tab 1">
        <Collection src="cities"/> 
        <Window class="container">
            <!-- Add TableView and  TableViewRow -->
            <TableView dataCollection="cities">
                <TableViewRow class="cityList" title="{nom_commune}" ID="{ID}" commune="{abrv_commune}" onClick="showCity"></TableViewRow>
            </TableView>
        </Window>   
    </Tab>
 
    <Tab title="tab 2">
        <Window id="win2" title="win 2" class="window">
            <Label text="window 2">                     
        </Window>
    </Tab>
 
  </TabGroup>
 
</Alloy>
So, all the cities/peoples stuff will be a part of my TabGroup (tab1), and then I will be able to organise other contents in more tabs (tab2, tab3, tab4, and so on...).

But Titanium says me that a Tab can only contain one child, which is intended to be a Window. So RIP my <Collection src="cities"/> and I have no data binding...

How am I supposed to do to implement this new navigation? THX a lot for your help, I really appreciate.


Viewing all articles
Browse latest Browse all 8068

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>