0
votes

Is it possible to open non-modal window (setting modal property of a window to false) from modal window using titanium on ios7? Right now when I create new non-model window from modal window and try to open it nothing happens. If I set the modal property to true than the window is opened properly.

Here is a very simple example (alloy app):

index.xml

<Alloy>
    <Window class="container">
        <Label id="label" onClick="doClick">Hello, World</Label>
    </Window>
</Alloy>

index.js

function doClick(e) {
    var modal = Alloy.createController('modal').getView();
    modal.open();
}

$.index.open();

modal.xml

<Alloy>
    <Window modal="false" backgroundColor="green">
        <Button title="Open red window" onClick="openWin"></Button>
    </Window>
</Alloy>

modal.js

var args = arguments[0] || {};

function openWin() {
    var win = Alloy.createController('win').getView();
    win.open();
}

win.xml

<Alloy>
    <Window modal="false" backgroundColor="red">
        <Label text="I am red window"></Label>
    </Window>
</Alloy>

So in modal.xml if you replace modal="false" with modal="true" the red window doesn't open any more!

1
Could you plz share code? - Wahhab_mirza
Code example added... - King Julien

1 Answers

1
votes

if you insist on opening a modal ontop of a modal, then change the second window to a view and just add it to the modal and then you can open multiple windows/views on top of a modal