{ "id": "62405", "key": "TIMOB-1773", "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": "11258", "description": "Holding Pen for Triaged Issues", "name": "Backlog", "archived": false, "released": false } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-04-15T03:01:54.000+0000", "created": "2011-04-15T03:01:49.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "ios", "regression", "scrub", "setactivetab" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T07:01:01.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

1.using todays pull, build and install KS on device or\nsimulator
\n2.launch and note which tab is opened

\n

results: opens to PLatform tab (tab3), when the script indicates\nit should open controls (tab 1)

\n

tabGroup.setActiveTab(1);

\n

this just broke

{html}", "attachment": [], "flagged": false, "summary": "Kitchensink opens on wrong tab", "creator": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126605", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

changed erroneous title

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:49.000+0000", "updated": "2011-04-15T03:01:49.000+0000" }, { "id": "126606", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is an order of operations problem. Here's the issue:

\n
\nvar tab4 = Titanium.UI.createTab({\n...\n    active:true\n});\n...\ntabGroup.addTab(tab4);\n...\ntabGroup.setActiveTab(1);\n...\ntabGroup.open(...)\n
\n

tab4 is explicitly set as 'active', but then before opening the\ntab group itself, we set the actual active tab. So which takes\nprecedence? What if there's more than one tab marked as 'active'\nwhen it's added to the tab group before opening? Currently, the\nfirst tab in the bar with 'active:true' is focused.

\n

We need some clarification on the issue. The reason order\nstarted changing is probably because of an iOS change, where one\nproperty was being set before the other - wasn't this around when a\nnew 4.1b/4.1 was released?

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:50.000+0000", "updated": "2011-04-15T03:01:50.000+0000" }, { "id": "126607", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm not sure I can answer these question (I'm not 100% sure\nabout the timing relative to 4.1), assigning to Ralf. If the\ncurrent behavior is correct, should android change its to reflect\nthis for parity?

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:50.000+0000", "updated": "2011-04-15T03:01:50.000+0000" }, { "id": "126608", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I don't know much but my expectation would be that the active\ntab is set to 1, and that should be the active tab, which seems to\nbe the old behavior on IOS and the current behavior on Android.

\n

To keep compatibility and just my instinct tells me we should\nhonor the \"last\" setActiveTab execution, if more than one\nexists.

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:50.000+0000", "updated": "2011-04-15T03:01:50.000+0000" }, { "id": "126609", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here's the problem. I do the following, instead of what's\ndescribed above:

\n
\ntabGroup.setActiveTab(0);\ntabGroup.add(Ti.UI.createTab({\n  active:true\n})\ntabGroup.open()\n
\n

Which one gets respected? We have no way to tell which was set\nfirst upon opening. We should simply say that the order is\nundefined.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:51.000+0000", "updated": "2011-04-15T03:01:51.000+0000" }, { "id": "126610", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry, changing back to needs-more-info.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:51.000+0000", "updated": "2011-04-15T03:01:51.000+0000" }, { "id": "126611", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Steve, it is always the last.

\n

Fundamentally whether by setActiveTab or via tab.group.add(...\nactive:true), the last one wins before the tabGroup.open()

\n

At the point of tabGroup.open() it should be the tab that was\ncreated and added in your latest example.

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:51.000+0000", "updated": "2011-04-15T03:01:51.000+0000" }, { "id": "126612", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

My point is that we don't KNOW which change was last when the\ntab is opened. It's obvious in the user's JS, but that's not how\nTitanium works internally - all properties are, for all intents and\npurposes, set in a specific order all the time always (there are in\nfact a lot of features which depend on this) upon certain\noperations (in this case, opening the tab group causes all of them\nto be set \"for real\").

\n

So we can't determine that information from property settings on\neither the tab or the tab group. The order is thus indeterminate\nand we should document it as such.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:51.000+0000", "updated": "2011-04-15T03:01:51.000+0000" }, { "id": "126613", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [aa66687741d962455f0d191e06e872b628f85ff9])\n[#1773 state:fixed-in-qa] Documentation updated\nto reflect ambiguous ordering of tab activation. \nhttp://github.com/appcelerator/titanium_mobile/commit/aa66687741d96...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:51.000+0000", "updated": "2011-04-15T03:01:51.000+0000" }, { "id": "126614", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Question:

\n
\ntabGroup = Ti.UI.createTabGroup({\n    activeTab:1,\n    tabs:[\n        tabGroup.add(Ti.UI.createTab({active:true}),\n        tabGroup.add(Ti.UI.createTab({})\n        ]\n    })\ntabGroup.open()\n
\n

Entries in a dict/object are unordered. Who wins?

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:52.000+0000", "updated": "2011-04-15T03:01:52.000+0000" }, { "id": "126615", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

OK, let's take a deep breath everyone. :)

\n

Let's all think the rationale for having an \"active: boolean\"\nproperty on Tab.

\n

Why do we need it?

\n

I think the undefined issue (above) would go away if it was\neither \"deprecated\" or \"read-only\".

\n

Why don't we think about this, and \"do the right thing\" if we\ncan.

\n

Steve, I'll take it back and change the state.

\n

When we understand the rationale and arguments, we'll have to\nmake a call make it part of the \"spec\" that doesn't exist now but\nwill exist sometime soon. :)

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:52.000+0000", "updated": "2011-04-15T03:01:52.000+0000" }, { "id": "126616", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

That sounds good. For now, I'm leaving the documentation change\nin.

\n

That's a good question. Tabs should have 'active' as a read-only\nproperty to determine whether or not they're the currently\ndisplayed tab.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:52.000+0000", "updated": "2011-04-15T03:01:52.000+0000" }, { "id": "126617", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

What did we choose on this, again?

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:52.000+0000", "updated": "2011-04-15T03:01:52.000+0000" }, { "id": "126618", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The comments above are relevant. I will have some interesting\nobservations in our upcoming API scrub.

\n

If we see this as an \"ordering issue\", please make sure that our\nKS code is \"fixed\" to launch to the first tab on both\nplatforms.

\n

Assigning to Steve to fix KS ASAP!

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:53.000+0000", "updated": "2011-04-15T03:01:53.000+0000" }, { "id": "126619", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [e3c8d2a13c626d84582035d4217bd4ec7ab8508f])\n[#1773] Updated KS to always start on 1st (Base\nUI) tab, unambiguously. \nhttps://github.com/appcelerator/titanium_mobile/commit/e3c8d2a13c62...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:53.000+0000", "updated": "2011-04-15T03:01:53.000+0000" }, { "id": "126620", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Setting to TBS because the requested KS change was made.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:53.000+0000", "updated": "2011-04-15T03:01:53.000+0000" }, { "id": "126621", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hey Stephen - I believe we need to keep line 90. If we comment\nout both 90 and 57 we get default tab set, which gets rid of the\ntest in KS. I ran this by Blain and he agrees. Ralfs at lunch right\nnow, wanted to send this back.

\n

tabGroup.setActiveTab(1);

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:54.000+0000", "updated": "2011-04-15T03:01:54.000+0000" }, { "id": "126622", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [cf498dde5a379ec9b361ff20bc8e694c1e83177e])\n[#1773] Provided requested fix. NOT marking this\nbug fixed because the underlying issue is not resolved. \nhttps://github.com/appcelerator/titanium_mobile/commit/cf498dde5a37...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:54.000+0000", "updated": "2011-04-15T03:01:54.000+0000" }, { "id": "126623", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The observations are correct that the order cannot be determined\nesp when using the activetab property.

\n

In a future API scrub, we will discuss this property. If it\nshould exist at all maybe it should be read-only.

\n

The only remaining question is setActiveTab().

\n

My opinion is that if multiple calls exist, the last call to\nthis function should be the tab that is active. Again, fodder for\nour API scrub.

\n

Our KitchenSink example is fixed and works the same on both\nplatforms as it should right now.

\n

My action is to place it in the TBS release, with\nneeds-more-info state and another tag stating it is due for API\nscrub.

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:01:54.000+0000", "updated": "2011-04-15T03:01:54.000+0000" }, { "id": "408822", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed and irrelevance. ", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T07:01:01.000+0000", "updated": "2017-03-03T07:01:01.000+0000" } ], "maxResults": 20, "total": 20, "startAt": 0 } } }