{ "id": "127009", "key": "TIMOB-16530", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15935", "description": "2014 Sprint 06", "name": "2014 Sprint 06", "archived": true, "released": true, "releaseDate": "2014-03-28" }, { "id": "15936", "description": "2014 Sprint 06 SDK", "name": "2014 Sprint 06 SDK", "archived": true, "released": true, "releaseDate": "2014-03-28" }, { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-23T23:43:11.000+0000", "created": "2014-03-02T06:30:35.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_tabgroup", "qe-testadded", "supportTeam" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [ { "id": "36019", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "124709", "key": "TIMOB-16184", "fields": { "summary": "Android: TabGroup setActiveTab not working if tabs are added with addTab method", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "35760", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "124709", "key": "TIMOB-16184", "fields": { "summary": "Android: TabGroup setActiveTab not working if tabs are added with addTab method", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-03-26T06:13:24.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5. Problem Description \r\n\r\nsetActive method is not working in tabgroup. It displays an error “Invalid tab index”.\r\n\r\nh5. Test Environment\r\n\r\nMac OX X 10.9.2\r\nTi SDK 3.1.3.GA, 3.2.0.GA, 3.2.1.GA\r\nTi CLI 3.2.1\r\nAndroid 2.3.3\r\n\r\nh5. Test Code \r\n\r\n{code}\r\nvar win1 = Ti.UI.createWindow({\r\n\ttitle : 'Win 1'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\tcolor : '#000',\r\n\tstyle : Ti.UI.iPhone.SystemButtonStyle.BORDERED,\r\n\ttitle : 'Set Active Tab 1'\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n\ttabGroup.setActiveTab(1);\r\n\t//Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);\r\n});\r\n\r\nwin1.add(button);\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n\ticon : 'KS_nav_ui.png',\r\n\ttitle : 'Tab 1',\r\n\twindow : win1\r\n});\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n\ttitle : 'Win 2'\r\n});\r\n\r\nvar tab2 = Ti.UI.createTab({\r\n\ticon : 'KS_nav_views.png',\r\n\ttitle : 'Tab 2',\r\n\twindow : win2\r\n});\r\n\r\nvar tabGroup = Ti.UI.createTabGroup({\r\n\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\n\r\n/*\r\n tabGroup.addEventListener('open', function(e) {\r\n tabGroup.setActiveTab(1);\r\n Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);\r\n });\r\n */\r\n\r\ntabGroup.setActiveTab(1);\r\n\r\ntabGroup.open();\r\n\r\n//Ti.API.info('********************* activeTab: ' + tabGroup.activeTab);\r\n\r\n{code}\r\n\r\nh5. Step to reproduce \r\n\r\n# Create ti sample project in titanium classic\r\n# Update app.js file with sample code \r\n# Run on android device/emulator \r\n# Check console log for error \r\n\r\nh5. Expected Result\r\n\r\nTab 2 will select when app is run.\r\n\r\nh5. Actual result \r\n\r\nTab 1 selected.\r\n\r\nh5. Logs\r\n\r\n{code}\r\n\r\n[ERROR] : TabGroupProxy: (KrollRuntimeThread) [390,390] Invalid tab index.\r\n\r\n\r\n{code}\r\n\r\n\r\nh5. Workaround Code \r\n\r\n{code}\r\nvar win1 = Ti.UI.createWindow({\r\n\ttitle : 'Win 1'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\tcolor : '#000',\r\n\tstyle : Ti.UI.iPhone.SystemButtonStyle.BORDERED,\r\n\ttitle : 'Set Active Tab 1'\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n\ttabGroup.setActiveTab(1);\r\n\t//Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);\r\n});\r\n\r\nwin1.add(button);\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n\ticon : 'KS_nav_ui.png',\r\n\ttitle : 'Tab 1',\r\n\twindow : win1\r\n});\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n\ttitle : 'Win 2'\r\n});\r\n\r\nvar tab2 = Ti.UI.createTab({\r\n\ticon : 'KS_nav_views.png',\r\n\ttitle : 'Tab 2',\r\n\twindow : win2\r\n});\r\n\r\nvar tabGroup = Ti.UI.createTabGroup({\r\n\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\n\r\n\r\n tabGroup.addEventListener('open', function(e) {\r\n tabGroup.setActiveTab(1);\r\n Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);\r\n });\r\n \r\n\r\n//tabGroup.setActiveTab(1);\r\n\r\ntabGroup.open();\r\n\r\n//Ti.API.info('********************* activeTab: ' + tabGroup.activeTab);\r\n\r\n{code}\r\n\r\n\r\nThanks\r\n", "attachment": [], "flagged": false, "summary": "Android: setActive tab is not working", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Mac OX X 10.9.2\r\nTi SDK 3.1.3.GA, 3.2.0.GA, 3.2.1.GA\r\nTi CLI 3.2.1\r\nAndroid 2.3.3\r\n", "comment": { "comments": [ { "id": "297830", "author": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "body": "PR:-\r\nhttps://github.com/appcelerator/titanium_mobile/pull/5219", "updateAuthor": { "name": "bijuexalture", "key": "bijuexalture", "displayName": "Biju pm", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-19T07:25:57.000+0000", "updated": "2014-03-19T07:25:57.000+0000" }, { "id": "298480", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Back port PR: https://github.com/appcelerator/titanium_mobile/pull/5511", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-24T20:54:53.000+0000", "updated": "2014-03-24T20:54:53.000+0000" }, { "id": "298534", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Verified the fix using the environment as\r\n\r\nDevice : Google Nexus 5, Android Version: 4.4.2\r\nSDK: 3.2.3.v20140324164913\r\nCLI version : 3.2.1\r\nOS : MAC OSX 10.9.2\r\nAlloy: 1.3.1\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nAppcelerator Studio, build: 3.2.3.201403190645\r\ntitanium-code-processor: 1.1.0\r\nXCode : 5.1 \r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-25T06:15:28.000+0000", "updated": "2014-03-25T06:15:28.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }