{ "id": "63328", "key": "TIMOB-2696", "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": "11257", "description": "", "name": "Sprint-2011-09", "archived": true, "released": true, "releaseDate": "2011-03-07" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:27:18.000+0000", "created": "2011-04-15T03:27:16.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "klist", "release-1.7.0", "reported-1.5.1", "reported-1.6.0", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-02T18:16:39.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": "{html}

sample of my code:

\n

tabGroup.addTab(tabSession);
\ntabGroup.addTab(tabResults);
\ntabGroup.addTab(tabMessages);
\ntabGroup.addTab(tabNews);
\ntabGroup.addTab(tabSettings);

\n

tabGroup.setActiveTab(4);
\ntabGroup.open();

\n

tabSettings is opened as expected, but tabSession is opened too.\nThis breaks my application as when tabSession opens it downloads a\nlist. This list is then put into tabSettings instead of tabSession\nbecause it is the active window.

\n

What I expected, and what happens in iOS, is that tabSettings is\nopened initially, and tabSession is not, until you click the\nSessions tab

\n

this is in Titanium Mobile 1.5.1

{html}", "attachment": [ { "id": "18191", "filename": "setactivetabsamplecode.zip", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:27:17.000+0000", "size": 1041, "mimeType": "application/zip" }, { "id": "18192", "filename": "setactivetabtracelog.rtf", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:27:17.000+0000", "size": 29935, "mimeType": "text/rtf" } ], "flagged": false, "summary": "Andoird: inital tab opened even if not active when call tabgroup.open", "creator": { "name": "eddieloeffen", "key": "eddieloeffen", "displayName": "Eddie Loeffen", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "eddieloeffen", "key": "eddieloeffen", "displayName": "Eddie Loeffen", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129217", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

I have replicated this issue. To be more precise, and to help\nget it fixed swiftly:

\n

Problem

\n

Given a not-yet-opened tabGroup, and two tabs (tab1, tab2),\ntabGroup.setActiveTab(tab2) will cause both tabs to be loaded, and\ncan result in the tabs contents getting loaded into the same\nview*.

\n

*Tab contents will only load into the same view if you load a\nlot of data in the window. If the load is quick enough, the\nmisbehavior will not be observed. I was able to reproduce the\nstacking every time by putting several hundred labels in both of my\ntabs.

\n

Expected Behavior

\n

Calling tabGroup.setActiveTab(tab2) would cause tab1 to not be\nloaded until the user clicks it. Further, tab1 should not load on\ntop of tab2.

\n

Tested On

\n

Tested on clean builds of Titanium Mobile 1.5.1, and 1.6.0 from\nJan 11th 2011.
\nBROKEN on Android Simulator 2.2
\nBROKEN on Android Device Samsung Epic 4G 2.1

\n

Sample Code

\n

Attached.

\n

Trace Log

\n

Attached.

\n

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/65201

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:27:17.000+0000", "updated": "2011-04-15T03:27:17.000+0000" }, { "id": "129218", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

there's another customer interested in this fix

\n

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/72451

{html}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:18.000+0000", "updated": "2011-04-15T03:27:18.000+0000" }, { "id": "129219", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

We'll look into this, but depending on OS controls\nloading/pre-loading behavior to not change is asking for trouble.\nThe double loading should not occur though.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:18.000+0000", "updated": "2011-04-15T03:27:18.000+0000" }, { "id": "129220", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

This behavior is actually core behavior in terms of how Android\nOS handles tabs currently.

\n

To get around the original problem, the logic for downloading\nthe list in question should be driven via an app event once\nwhatever logic (such a login) has completed in the desired active\ntab rather than just launching due to the tab opening.

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:27:18.000+0000", "updated": "2011-04-15T03:27:18.000+0000" }, { "id": "408330", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-02T18:16:35.000+0000", "updated": "2017-03-02T18:16:35.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }