Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9436] Android:Tabgroup:Focus and Blur event listeners for a tabgroup are not getting called.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-13T04:50:24.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-12 API
ComponentsAndroid
Labelsapi, module_tabgroup, qe-and060112, qe-testadded, regression
ReporterShyam Bhadauria
AssigneeJosh Roesslein
Created2012-06-06T23:43:24.000+0000
Updated2013-12-10T05:59:09.000+0000

Description

It is a regression.Not occurring over 2.0.2,2.0.1 and 1.8.2. Refer the code below:
var tabGroup = Ti.UI.createTabGroup();

var win1 = Ti.UI.createWindow({
	name: "win 1"
});
var tab1 = Ti.UI.createTab({
	name: "Tab 1",
	title:'Tab 1',
	window:win1
});

var win2 = Ti.UI.createWindow({
	name: "win 2",
	title:'Tab 2',
	backgroundColor:'#fff'
});
var tab2 = Ti.UI.createTab({
	name: "Tab 2",
	title:'Tab 2',
	window:win2
});

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);

tabGroup.addEventListener('focus', function(e){
	Ti.API.info('-------------> this is focus of tabgroup');
	Ti.API.info('-------------> tabGroup focus event fired! - ' + e.source.name);
});
tab1.addEventListener('focus', function(e){
	Ti.API.info('-------------> this is focus of tab 1');
	Ti.API.info('-------------> tab1 focus event fired! - ' + e.source.name);
});
tab2.addEventListener('focus', function(e){
	Ti.API.info('-------------> this is focus of tab 2');
	Ti.API.info('-------------> tab2 focus event fired! - ' + e.source.name);
});
win1.addEventListener('focus', function(e){
	Ti.API.info('-------------> this is focus of win 1');
	Ti.API.info('-------------> win1 focus event fired! - ' + e.source.name);
});
win2.addEventListener('focus', function(e){
	Ti.API.info('-------------> this is focus of win 2');
	Ti.API.info('-------------> win2 focus event fired! - ' + e.source.name);
});

tab1.addEventListener('blur', function(e){
	Ti.API.info('-------------> this is blur of tab 1');
	Ti.API.info('**************> tab1 blur event fired! - ' + e.source.name);
});
tab2.addEventListener('blur', function(e){
	Ti.API.info('-------------> this is blur of tab 2');
	Ti.API.info('**************> tab2 blur event fired! - ' + e.source.name);
});
win1.addEventListener('blur', function(e){
	Ti.API.info('-------------> this is blur of win 1');
	Ti.API.info('**************> win1 blur event fired! - ' + e.source.name);
});
win2.addEventListener('blur', function(e){
	Ti.API.info('-------------> this is blur of win 2');
	Ti.API.info('**************> win2 blur event fired! - ' + e.source.name);
});

tabGroup.open();
Issue -> The focus and blur events of tabgroup are not getting called. Attached are the log traces of SDKs 2.0.2 and 2.1.0.

Attachments

FileDateSize
Logging2.0.2.txt2012-06-06T23:43:24.000+0000713
Logging2.1.0.txt2012-06-06T23:43:24.000+0000266

Comments

  1. Josh Roesslein 2012-06-07

    [PR #2351](https://github.com/appcelerator/titanium_mobile/pull/2351) sent to resolve issue.
  2. Michael Pettiford 2012-06-18

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1, Nexus S OS 4.0.4 The expected behavior is shown
  3. Shyam Bhadauria 2012-07-13

    Re-opening to edit label
  4. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074

JSON Source