[TIMOB-2551] iOS: Using tabGroup.setActiveTab to switch to a tab in "More..." fails to initialize window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-23T21:03:11.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2013 Sprint 15 API, 2013 Sprint 15, Release 3.2.0 |
Components | iOS |
Labels | api, module_tabgroup, qe-testadded, supportTeam |
Reporter | wallneradam |
Assignee | Vishal Duggal |
Created | 2011-04-15T03:22:33.000+0000 |
Updated | 2014-10-20T22:31:40.000+0000 |
Description
Problem
There is a bug with tabGroup. When I want to switch to a tab under the "More..." tab with tabGroup.setActiveTab, the content of the window is not initialized. If I first click to More then try to switch with setActiveTab it works good.Small snippet
An example. Click the last button.
var tg = Ti.UI.createTabGroup();
var fw = null;
for (var i=0; i<9; i++) {
var f = function(i) {
var w = Ti.UI.createWindow({
title: 'Tab ' + i,
backgroundColor: '#fff'
});
var t = Ti.UI.createTab({
title: w.title,
window: w,
icon:'KS_nav_ui.png'
});
if (i > 0) {
var l = Ti.UI.createLabel({
text: w.title + ' Label'
});
w.add(l);
var btn = Ti.UI.createButton({
top: i*40 - 20, height: 35,
left: 100, width: 120,
title: 'Jump to Tab ' + i
});
btn.addEventListener('click', function(e) {
tg.setActiveTab(t);
});
fw.add(btn);
} else {
fw = w;
}
tg.addTab(t);
}(i);
}
tg.open();
*EDIT BY STEVE:* Code removed. Developer who implements this feature should not look at or use this code due to possible rights issues.
FYI - Unable to reproduce with 2.2 API's on Android with latest pull of 1.5.1 from master @ 12/11/2010 1:10AM CST.
Associated HD ticket
PRO customer relying on this, http://appc.me/c/APP-717823Target environment
{noformat} Product: Mobile SDK - Mobile 1.7.1 Platform OS: iOS - Version 4.2 {noformat}Tested on
Emulator iOS 4.xProblem
Similar issue encountered where customer want to switch to a tab under the "More..." tab with contents of the window is not properly loaded. Window inside the MoreTab has no view inside [image](http://imageshack.us/photo/my-images/593/windowinmore.png/). Usual view of that window [image](http://imageshack.us/photo/my-images/40/normalwindow.png/). Once the number of tabs have decreased [image](http://imageshack.us/photo/my-images/641/windowwomore.png/).FYI: Just encountered the same problem with the continuous builds (1.7.3.v20110826161351). @wallneradam's solution solved my problem.
I encountered the same problem with build 1.7.2.97c3689. @wallneradam's solution worked for me. I imagine that when initializing windows and UI elements within 'More' Tabs, Titanium is looking up the chain of windows for initialization information and the 'More' part of that chain is incomplete.
Hello Appcelerator Team, Please implement Wallneradam solution in the upcoming releases. The behavior of the setActiveTab with more then 5 tab groups is a bug and the solution is in this post, so why wait to implement this? Now I need to implement it myself every time a new version is published.
@Remko we cannot use code added to a JIRA. If you'd like to submit this as a patch then please sign our CLA and submit a pull request. [Guide to Contributing](http://wiki.appcelerator.org/display/guides/How+to+Contribute+Code)
.
Confirmed SDK 2.2.0.014b86f.
Still a problem in SDK 2.1.3RC
I know there may be rights issues, but this bug is VERY bad. Can someone PLEASE provide a fix.
Any news regarding this bug? I have the same problem in the latest SDK Version (3.1) and it is really annoying :-(
Seriously? This bug, for which a fix was already given, is still unaddressed after *2 years*??
I reproduced the issue, using: Appcelerator Studio, build: 3.1.1.201306131423 Titanium SDK, build: 3.1.1GA iPhone 5 iOS 7.0 Xcode5 CLI 3.1.1 KitchenSink Version 3.1.1.GA
[~kelek] Apologies, but we couldn't use the previously posted solution. I have scheduled this for an upcoming release.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/4469
Tested with: OSX: 10.8.5 Xcode:5.0 Appcelerator Studio: 3.2.0.201310152355 SDK:3.2.0.v20131016191202 acs:1.0.7 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processo:1.0.3
This issue, although fixed last year, appears to be back in Titanium 3.4.0.GA + iOS 8.0.2