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

Android: TabGroup - TabGroup.setActiveTab() does not open the intended tab for the first time.

    Details

      Description

      TabGroup.setActiveTab() does not open the intended tab for the first time.
      This is not regression since the issue occurs on 3.0.2 GA as well.

      Steps to reproduce:
      1. Create an app using the code below.
      2. Launch the test app. A window with five buttons is opened.
      3. Click on 'open activeTab1'.

      Actual:
      Tab0 is opened.

      Expected:
      Tab1 should be opened.

      var window1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'#fff',
          layout:'vertical'
      });
      	 
      	var b1 = Ti.UI.createButton({
      	    title:'Open activeTab 1',
      	    top:5
      	})
      	var b2 = Ti.UI.createButton({
      	    title:'Open activeTab 2',
      	    top:5
      	})
      	var b3 = Ti.UI.createButton({
      	    title:'Open activeTab tab1',
      	    top:5
      	})
      	var b4 = Ti.UI.createButton({
      	    title:'Open activeTab tab2',
      	    top:5
      	})
      	var b5 = Ti.UI.createButton({
      	    title:'Open ',
      	    top:5
      	})
      	window1.add(b1);
      	window1.add(b2);
      	window1.add(b3);
      	window1.add(b4);
      	window1.add(b5);
      	var tabGrp = Ti.UI.createTabGroup();
      	 
      	var win0 = Ti.UI.createWindow({
      	    title:'TAB 0',
      	    backgroundColor:'white'
      	})
      	 
      	var tab0 = Ti.UI.createTab({
      	    window:win0,
      	    title:'tab0'
      	})
      	 
      	var closeBtn0 = Ti.UI.createButton({
      	    title:'CLOSE TABGRP'
      	})
      	 
      	win0.add(closeBtn0);
      	 
      	var win1 = Ti.UI.createWindow({
      	    title:'TAB 1',
      	    backgroundColor:'white'
      	})
      	 
      	var tab1 = Ti.UI.createTab({
      	    window:win1,
      	    title:'tab1'
      	})
      	 
      	var closeBtn1 = Ti.UI.createButton({
      	    title:'CLOSE TABGRP'
      	})
      	 
      	win1.add(closeBtn1);
      	 
      	var win2 = Ti.UI.createWindow({
      	    title:'TAB 2',
      	    backgroundColor:'white'
      	})
      	 
      	var tab2 = Ti.UI.createTab({
      	    window:win2,
      	    title:'tab2'
      	})
      	 
      	var closeBtn2 = Ti.UI.createButton({
      	    title:'CLOSE TABGRP'
      	})
      	 
      	win2.add(closeBtn2);
      	 
      	 
      	tabGrp.tabs = [tab0,tab1,tab2];
      	 
      	b1.addEventListener('click',function(){
      	    tabGrp.activeTab = 1;
      	    tabGrp.open();
      	})
      	 
      	b2.addEventListener('click',function(){
      	    tabGrp.activeTab = 2;
      	    tabGrp.open();
      	})
      	 
      	b3.addEventListener('click',function(){
      	    tabGrp.activeTab = tab1;
      	    tabGrp.open();
      	})
      	 
      	b4.addEventListener('click',function(){
      	    tabGrp.activeTab = tab2;
      	    tabGrp.open();
      	})
      	 
      	b5.addEventListener('click',function(){
      	    tabGrp.open();
      	})
      	 
      	closeBtn0.addEventListener('click',function(){
      	    tabGrp.close();
      	})
      	 
      	closeBtn1.addEventListener('click',function(){
      	    tabGrp.close();
      	})
      	 
      	closeBtn2.addEventListener('click',function(){
      	    tabGrp.close();
      	})
      	 window1.open();
       
      	
      

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              amittal Anshu Mittal
              Reviewer:
              Ping Wang
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration