Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19208] Windows: CommandBar disappears after closing overlapping Window

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-07-16T07:43:04.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sRelease 5.0.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2015-07-10T09:58:08.000+0000
Updated2015-08-04T16:07:07.000+0000

Description

Window.CommandBar which is associated with Ti.UI.Window disappears when creating new Window from Tab. For example in following sample code the CommandBar which is associated with win1 disappears after closing overlapping Window. It's ok to hide it when overlapping Window is active, but it should restored when overlaping Window is closed.
var tabGroup = Titanium.UI.createTabGroup();

var win1 = Titanium.UI.createWindow({
    title: 'Tab 1',
    backgroundColor: '#fff'
});
var tab1 = Titanium.UI.createTab({
    icon: 'KS_nav_views.png',
    title: 'Tab 1',
    window: win1
});

var label1 = Titanium.UI.createLabel({
    color: '#999',
    text: 'I am Window 1',
    font: { fontSize: 20, fontFamily: 'Helvetica Neue' },
    textAlign: 'center',
    width: 'auto'
});

win1.add(label1);

var platform = Ti.Platform.osname;
if (platform === 'windowsphone' || platform === 'windowsstore') {
    var commandBar1 = Ti.UI.Windows.createCommandBar();
    var addButton = Ti.UI.Windows.createAppBarButton({ icon: Ti.UI.Windows.SystemIcon.ADD });
    addButton.addEventListener('click', function () {
        var window = Ti.UI.createWindow({ backgroundColor: 'green' });
        var closeButton = Ti.UI.createButton({ title: 'Close' });
        closeButton.addEventListener('click', function () {
            window.close();
        });
        window.add(closeButton);
        window.open();
    });
    commandBar1.items = [addButton];
    win1.add(commandBar1);
}

tabGroup.addTab(tab1);

tabGroup.open();

Comments

  1. Kota Iguchi 2015-07-14

    https://github.com/appcelerator/titanium_mobile_windows/pull/370
  2. Lokesh Choudhary 2015-07-28

    Verified the fix. The commandbar does not disappear. Closing. Environment: Appc Studio: 4.1.1.201507141126 Ti SDK: 4.2.0.v20150724170431 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0 APPC CLI: 4.1.2 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1

JSON Source