[TIMOB-19111] Windows: Ti.UI.Windows.CommandBar.items.push(item) does not work
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2015-07-03T09:47:14.000+0000 |
| Affected Version/s | Release 4.1.0 |
| Fix Version/s | Release 5.0.0 |
| Components | Windows |
| Labels | n/a |
| Reporter | Fokke Zandbergen |
| Assignee | Kota Iguchi |
| Created | 2015-06-30T11:59:13.000+0000 |
| Updated | 2015-08-04T16:06:29.000+0000 |
Description
While creating a polyfill for the missing Alloy XML support for CommandBar I discovered that:
var backButton = Ti.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.BACK
}),
likeButton = Ti.UI.Windows.createAppBarToggleButton({
icon: Ti.UI.Windows.SystemIcon.LIKEDISLIKE
}),
forwardButton = Titanium.UI.Windows.createAppBarButton({
icon: Ti.UI.Windows.SystemIcon.FORWARD
}),
commandBar = Ti.UI.Windows.createCommandBar({
items: [backButton, likeButton]
}),
win = Ti.UI.createWindow();
commandBar.items.push(forwardButton);
win.add(commandBar);
win.open();
does not work (the commandBar displays empty) while:
var items = commandBar.items;
items.push(forwardButton);
commandBar.items = items;
does work.
I would mark it as "Won't Fix" or "Invalid", because it is not supported on other platforms too. It is not updated because in this case
pushoperation is basically done on *JavaScript Array object*, not onto Titanium proxy. For example, following code does not add new Tab (Tested on iOS).var win1 = Ti.UI.createWindow({ backgroundColor: 'blue', title: 'Blue' }); win1.add(Ti.UI.createLabel({text: 'I am a blue window.'})); var win2 = Ti.UI.createWindow({ backgroundColor: 'red', title: 'Red' }); win2.add(Ti.UI.createLabel({text: 'I am a red window.'})); var tab1 = Ti.UI.createTab({ window: win1, title: 'Blue' }), tab2 = Ti.UI.createTab({ window: win2, title: 'Red' }), tabGroup = Ti.UI.createTabGroup({ tabs: [tab1, tab2] }); var win3 = Ti.UI.createWindow({ backgroundColor: 'green', title: 'Green' }); win3.add(Ti.UI.createLabel({text: 'I am a green window.'})); var tab3 = Ti.UI.createTab({ window: win3, title: 'Green' }); tabGroup.addEventListener('open', function() { setTimeout(function() { tabGroup.tabs.push(tab3); //tabGroup.tabs = [tab1, tab2, tab3]; alert('Pushed new tab. Does it work?'); }, 3000); }); tabGroup.open();Closing as per above discussion, please reopen if needed.
Won't fix tickets don't get a fix version.