Onsen UI Back Button

119 Views Asked by At

I'm new to Onsen UI, and have been using it to build out a small mobile app for my wife's company. I initially was laying out my project using a single page, but that's starting to become a bit cumbersome as the project grows. Today I started breaking up my project into individual pages, and have the initial framework working but suddenly my ons-back-button isn't showing up. In reviewing the Onsen UI docs, I was surprised to see that the back button is a component of the ons-toolbar object (I think I came up with my initial working version playing around in the Onsen Playground). I'm wondering if the reason why this broke is because I don't have the back button in an ons-toolbar: it is in a div at the bottom of my page:

<div>
  <ons-back-button>Back</ons-back-button>
  <div class="right-float">
    <ons-button id="push-button" onclick="next()"></ons-button>
  </div>
</div>

Is it possible to use the ons-back-button with multi-page projects without placing in an ons-toolbar? No big deal if not, but just curious as to why this was previously working and now not.

1

There are 1 best solutions below

0
denkom On

Figured it out - I was using resetToPage method, so nothing was on my page stack. As soon as I used popPage(), my back button showed up.