Page 1 of 1

Don't reload page on window.history.back();

Posted: Fri Jun 06, 2014 11:15 am
by pjamourik

Hi Guys,

Another question I can't find an answer to :

I have a result page with a grid. Through a servcice the grid is populated when loading the page.

When i click one cell i want to show the details in another page.

In the other page I have the option to navigate "Back" (header button).

When I do this the original page is empty, or reloaded.

Is there a nice solutions that the page can be return to the situation when i clicked on the cell (so also the scroll-position is intact)?

Thanks in advance,

Peter


Don't reload page on window.history.back();

Posted: Fri Jun 06, 2014 12:45 pm
by Kateryna Grynko

Hi Peter,

Let me tell you how our events work.

We store two pages: your current page and the previous one. startScreen is loaded once - for the first time you open it.

If you fill the grid on Load event, it won't be filled again when you return to it.
If you go 'further' it will be reloaded when you return.


Don't reload page on window.history.back();

Posted: Sat Jun 14, 2014 1:53 pm
by Slava Balabanov

Hi. I was about to ask the same question as Peter.
What you are saying is not whats happening to me actually.

I have 3 pages. 1. login 2. a list that is being populated on page load 3. details page.

Once i'm in the second page and click on a list item, i go to the details page
(Now the second page - previous - should be stored right?).
I click the back header button and i go back to the second page with the list, and i see that the list populates again like the Load event was fired again (i've put console.log lines for verification).

So i dont see the store thing working. Anyway to check if i do something wrong or why doesnt it work?
Thanks!


Don't reload page on window.history.back();

Posted: Sat Jun 14, 2014 2:21 pm
by obullei

Hello Peter!

We are working on it at the moment and will get back to you with update as soon as possible.


Don't reload page on window.history.back();

Posted: Sat Jun 14, 2014 9:59 pm
by Alena Prykhodko

Hi Slava,

Please try with "Render all pages in one HTML file (jQuery Mobile multi-page template)" checked in App settings.


Don't reload page on window.history.back();

Posted: Tue Jun 24, 2014 5:13 pm
by Slava Balabanov

Hi,
Thanks for this. but now when i click back and on another link the data doesnt refresh.
i mean, i have a list with different values in. When i click on an item i go to the details page. when i go back to the previous page i see that the list is not loaded again and all is good.
If i click on another list item, it moves to the details page but i see the details of the previous item - i guess that the load events dont fire here.
Should i use PageShow events instead of Load? or is there something more suitable?


Don't reload page on window.history.back();

Posted: Tue Jun 24, 2014 6:55 pm
by Evgene Karachevtsev

Hello Slava,

Yes, the load event now will be triggered only at the first time. You should use page show instead of the load.