Search code examples
onsen-ui

ons-split-view. Template error "Page not found"


I have a Split View defined as:

<ons-split-view
    var="noticies_split"
    secondary-page="secundaria"
    main-page="principal"
    main-page-width="70%"
    collapse="portrait">
</ons-split-view>

I get a "Page is not found: principal" if I define both templates consecutively, i.e.:

<ons-template id="secundaria">
</ons-template>
<ons-template id="principal">
</ons-template>

If I define a third template between them, it works fine, i.e:

<ons-template id="secundaria">
</ons-template>
<ons-template id="aux">
</ons-template>
<ons-template id="principal">
</ons-template>

When defining more than 2/3 templates, I get the same error for those in even positions, but not for the odd ones.

Anyone can help?

I posted an issue on github project: ISSUE #392

I'm using onsenui - v1.2.1 - 2014-12-01


Solution

  • I got same result with onsen-tabbar.

    I fixed it by moving onsen-template inside onsen-tabbar tag

    Example:

    <ons-tabbar>
        <div style="display:none">
            <ons-template id="page1.html">
            </ons-template>
            <ons-template id="page2.html">
            </ons-template>
            <ons-template id="page3.html">
            </ons-template>
        </div>
    
        <ons-tab page="page1.html" active="true">
        </ons-tab>
        <ons-tab page="page2.html">
        </ons-tab>
        <ons-tab page="page3.html">
        </ons-tab>
    </ons-tabbar>
    

    Hope it can solve your problem.

    Cheers...