GOING BACK from third level page, always getting undefined variable


#1

I tried stackPages to true in view using the lastest f7 version and does not work either, I have a problem that after third level page when going back the previously pages return undefined object variable and js stop working…

I have used this and same problem:
// Init App
var app = new Framework7({
id: ‘io.framework7.testapp’,
root: ‘#app’,
theme: theme,
domCache: true,
removeElements: false,
view: {
stackPages: true,
},
data: function () {
return {
user: {
},
};
},
methods: {
helloWorld: function () {
app.dialog.alert(‘Hello World!’);
},
},
routes: routes,
vi: {
placementId: ‘pltd4o7ibb9rc653x14’,
},
});

Explaining a little more

First page:

Looking for hotels in a location, here this a form input for this purpose, after request the json with the list of hotels I send the object varianle allHotels to the second page.

Second Page:

Showing the list of hotels and reading the hotels list from the object variable sent from First Page. Called allHotels, from this page I want to look for hotels details to get more info about the hotel and when i click on a hotel I go to the third page below and I pass a new object variable called hoteldetails with the hotel details

Third Page:

In this page I show the hotel details reading the hotel details from the object variable hoteldetails…

If I go back from third page to previous second page then the error comes up with undefined object but this undefined object belongs to the first page not to the second page… it looks like the DOM keep reading when back first page as the second one, but showing me the second one when back…

any solution?
thanks


#2

I tried stackPages: true, and not working in my case:
this is my config in my app.js:

var app = new Framework7({
id: ‘io.framework7.testapp’,
root: ‘#app’,
theme: theme,
domCache: true,
removeElements: false,
view: {
stackPages: true,
},


#3

can you make a small fiddler with the error?
also, pleas wrap your code in quotes (three single quotes) like this:
```

your code goes here

```

this will be the output:

var app = new Framework7({
  id: ‘io.framework7.testapp’,
  root: ‘#app’,
  theme: theme,
  domCache: true,
  removeElements: false,
  view: {
  stackPages: true,
  }
}

#4

thanks! I think I will have to do that… I am trying to keep the previous pages on DOM when going back, going back from level two page no problem going back from level third page the problem appears with undefined object… error and not possible to return back…

I will try to put it in fiddler…