Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-3628

Android: setActiveTab does not switch tabs if child window opened in tab

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Invalid
    • Affects Version/s: Release 1.6.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Android 2.2 Emulator, TiSDK 1.6.1

      Description

      If you open a window inside of a tab and then call setActiveTab, the tab switches as it should behind the open window. You never see this because the open window is not hidden in the process. This can be seen in KitchenSink 'Base UI'>'Tab Groups'>'Set Active Tab(either)'.

      Step 1: run the code below
      Step 2: click the 'Open Child Window' button
      Step 3: click the 'Tab 2' button
      Step 4: notice that nothing happens
      Step 5: hit the back button
      Step 6: notice that the tab is changed

      Titanium.UI.setBackgroundColor('#000');
       
      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
       
      //
      // create base UI tab and root window
      //
      var win1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'#fff'
      });
      var button1 = Ti.UI.createButton({
      	title: 'Open child window'
      });
      button1.addEventListener('click', function(e){
      	childWin = Titanium.UI.createWindow({
      		title:'Tab 1 Child',
      		backgroundColor:'#fff'
      	});
      	
      	var button2 = Ti.UI.createButton({
      		title: 'Tab 2'
      	});
      	button2.addEventListener('click', function(e){
      		tabGroup.setActiveTab(tab2);
      	});
      	childWin.add(button2);
      	
      	Titanium.UI.currentTab.open(childWin,{animated:true});
      });
      win1.add(button1);
       
      var tab1 = Titanium.UI.createTab({  
          icon:'KS_nav_views.png',
          title:'Tab 1',
          window:win1
      });
       
      //
      // create controls tab and root window
      //
      var win2 = Titanium.UI.createWindow({  
          title:'Tab 2',
          backgroundColor:'#fff'
      });
      var tab2 = Titanium.UI.createTab({  
          icon:'KS_nav_ui.png',
          title:'Tab 2',
          window:win2
      });
       
      var label2 = Titanium.UI.createLabel({
      	color:'#999',
      	text:'I am Window 2',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win2.add(label2);
       
      //
      //  add tabs
      //
      tabGroup.addTab(tab1);
      tabGroup.addTab(tab2);  
       
      // open tab group
      tabGroup.open();

      Tested On

      Android 2.2 Emulator, TiSDK 1.6.1

      Associated Helpdesk Ticket

      http://support-admin.appcelerator.com/display/UUP-44372-885

        Attachments

          Activity

            People

            • Assignee:
              dthorp Don Thorp
              Reporter:
              jalter Jon Alter
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-3098
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration