Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16782] BlackBerry: Ti.UI.Window events not fired

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-05-07T06:12:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsBlackBerry
LabelsBlackBerry, look1
ReporterHazem Khaled
AssigneePedro Enrique
Created2014-02-15T01:56:50.000+0000
Updated2017-03-14T21:08:39.000+0000

Description

Issue description

Events open, focus event not woking on Ti.UI.Window for BB10. To replicate just keep clicking Open & Close buttons, back'n forth.

Check code example

Ti.API.info('Loading app.js');

var masterWindow = Ti.UI.createWindow({
	title : 'Master Window',
	barColor : '#000000',
	backgroundColor : 'green'
});
masterWindow.addEventListener('focus', function() {
	Ti.API.info('Master Window focused');
});

masterWindow.addEventListener('open', function() {
	Ti.API.info('Master Window opened');
});

masterWindow.addEventListener('close', function() {
	Ti.API.info('Master Window closed');
});

var detailWindow = Ti.UI.createWindow({
	title : 'Detail Window',
	backgroundColor : '#ffffff'
});

detailWindow.addEventListener('focus', function() {
	Ti.API.info('Detail window focused');
});
detailWindow.addEventListener('open', function() {
	Ti.API.info('Detail window opened');
});
detailWindow.addEventListener('close', function() {
	Ti.API.info('Detail window closed');
});

var btnClose = Ti.UI.createButton({
	title : 'Close'
});
btnClose.addEventListener('click', function() {
	detailWindow.close();
});
detailWindow.add(btnClose);

var btnOpen = Ti.UI.createButton({
	title : 'Open'
});

btnOpen.addEventListener('click', function() {
	detailWindow.open();
});
masterWindow.add(btnOpen);

masterWindow.open();

Console output

From time to time iOS fires Window events consistently.
[INFO] :   Loading app.js
[DEBUG] :  Application booted in 112.212002 ms
[INFO] :   Master Window opened
[INFO] :   Master Window focused
[INFO] :   Detail window opened
[INFO] :   Detail window focused
[INFO] :   Detail window closed
[INFO] :   Master Window focused
[DEBUG] :  Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/224D5BC6-B644-43FE-8678-89C63A0C3A30/BlackBerryTests.app/_app_props_.json, Resource: _app_props__json
[INFO] :   Detail window opened
[INFO] :   Detail window focused
[INFO] :   Detail window closed
[INFO] :   Master Window focused
BlackBerry isn't firing Window focus events and Master Window Open event is only fired once.
[INFO] Loading app.js
[INFO] Master Window opened

[INFO] Detail window opened

[INFO] Detail window closed

[INFO] Detail window opened

[INFO] Detail window closed

Comments

  1. Pedro Enrique 2014-05-01

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/218
  2. Eric Merriman 2017-03-14

    Closing as resolved.

JSON Source