w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

When page is loaded from cache, no page load event is invoked.

I have a select menu which is populated by a rest service.

When I test the app in the browser for the 1st time, everything is working ok.
But when I test it again, without clearing browser cache, then the select menu is not populated, presumably because the page load event is not triggered.

The same happens when I test native on a smartphone. 1st time ok, next time the menu is not populated.

I could use pageshow event, but the problem with this is that the pageshow event is also triggered when you use the back button (from the next page for example) and land on the page, then the select menu is repopulated with calls to the rest service. In case of back button, when using pageload event, the browser doesn't repopulate the menu, but it is also not empty, the select menu contains the values from the initial rest call.

So how can I combine this behaviour? I want the selectmenu to be repopulated when the app is started, but not when using the back button, then he should use cached items.

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

When page is loaded from cache, no page load event is invoked.

The pageshow event is even triggered when I select something from the selectmenu, because the selectmenu is shown as a dialog (because jquery does this when the selectmenu contains a lot of values), and when closing the dialog, a pageshow event is triggered.

So in my case, the pageshow event is triggered when the page is loaded, the selectmenu is populated while using a rest call, you choose something from the list, and then the selectmenu would be repopulated using a new rest call.
And this is not the behaviour that i want, because the 2nd rest call is totally unnecessary.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

When page is loaded from cache, no page load event is invoked.

Hi!

Working on it. I'll update!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

When page is loaded from cache, no page load event is invoked.

Could you please share screen shot of mapping?

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

When page is loaded from cache, no page load event is invoked.

And the service is invoked at the Page Load event

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

When page is loaded from cache, no page load event is invoked.

The mapping looks right. Can you share the service URL?

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

When page is loaded from cache, no page load event is invoked.

I solved it, there was a problem in configuring my service, which was configured with a sessionStorage variable.
So when the browser reloaded, or the native app restarted, al localStorage vars were still there, but the sessionStorage was gone.

Thank you anyway!

Return to “Issues”