TIMOB-27316 allowed this in the SDK so Alloy needs to allow it too, test code from that ticket below
function openWindow() {
var childWindow = Ti.UI.createWindow({
title: "Child Window",
backgroundColor: "white",
});
var closeButton = Ti.UI.createButton({
title: "Close Window",
});
closeButton.addEventListener("click", function() {
$.index.closeWindow(childWindow, { animated: true });
});
childWindow.add(closeButton);
$.index.openWindow(childWindow, { animated: true });
}
function openTabGroup() {
var tabGroupSettings = {
title: "TabGroup",
tabs: [createTab("Tab 1"), createTab("Tab 2"), createTab("Tab 3")],
};
var tabGroup = Ti.UI.createTabGroup(tabGroupSettings);
$.index.openWindow(tabGroup, { animated: true });
}
function createTab(title) {
var window = Ti.UI.createWindow({ title: title });
window.add(Ti.UI.createLabel({
text: title + " View",
top: "25%",
}));
var openButton = Ti.UI.createButton({
title: "Open Child Window",
top: "50%",
});
openButton.addEventListener("click", function() {
var childWindow = Ti.UI.createWindow({
title: title + " Child Window",
backgroundColor: "white",
});
var closeButton = Ti.UI.createButton({
title: "Close Window",
});
closeButton.addEventListener("click", function() {
$.index.closeWindow(childWindow, { animated: true });
});
childWindow.add(closeButton);
$.index.openWindow(childWindow, { animated: true });
});
window.add(openButton);
var tab = Ti.UI.createTab({
title: title,
icon: "/assets/images/tab1.png",
window: window,
});
return tab;
}
$.index.open();
PR: https://github.com/appcelerator/alloy/pull/1067
alloy-devkit PR: https://github.com/appcelerator/alloy-devkit/pull/222