jasonkneen/nl.fokkezb.drawer

There's a way to use NavigationWindow from xp.ui ?

Closed this issue · 6 comments

I'm trying to use NavigationWindow from your xp.ui but on android side I'm getting this error when I open the app:

Cannot call method 'replace' of undefined

Here's my code for test:

<Alloy>
    <Widget id="drawer" src="nl.fokkezb.drawer">

        <Window module="xp.ui" role="leftWindow" id="leftView">
            <Label>Test</Label>
        </Window>

        <NavigationWindow module="xp.ui" role="centerWindow" id="nav">
            <Window id="win">
                  <Label>Test</Label>
            </Window>
        </NavigationWindow>

    </Widget>

</Alloy>

Thanks

You can't use the {{xp.ui}} version of {{NavigationWindow}} in the drawer widget, that's also why I don't have that in the example in the README. It only works when it's the top level element because it doesn't return a proxy but a plain JS object.

That's sad =(

But thank you Fokke

You can't have a NavigationWindow on Android...
You could use something like this...

<Alloy>
    <Widget id="drawer" src="nl.fokkezb.drawer">

        <Window module="xp.ui" role="leftWindow" id="leftView">
            <Label>Test</Label>
        </Window>

        <NavigationWindow platform="ios" role="centerWindow" id="nav">
            <Window id="win">
                  <Label>Test</Label>
            </Window>
        </NavigationWindow>
        <Window platform="android" module="xp.ui" role="centerWindow" id="nav">
                  <Label>Test</Label>
        </Window>

    </Widget>

</Alloy>

This would give Android a window and iOS a navigationWindow.

@adamkearsley Indeed, and you could even use <Require> to re-use the same controller for the actual contents of that iOS Navigation Window and Android View.

Thats really sad.. We could be using open and close or openWindow, closeWindow in Android like we do in iOS if this worked.

I was searching all over the internet trying to find such a solution...
Too bad I'm not experienced enough to build this on my own.

See my answer to #59.