Jean-Philippe Steck
Posts: 0
Joined: Sat Nov 30, 2013 11:09 am

How to avoid refresh delay when reading data on page load ?

With master-detail pages. I do :

  • set the id of the selected item in local storage

  • naviage to detail page

  • on 'page show' in the detail page I read data from the database using the id

  • the detail page has a back button to return to the master list

    My problem is that the detail page is showing the previous data for 1-2 seconds until the read service has returned and the contente of the page is refreshed.

    How to avoid this ?

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

How to avoid refresh delay when reading data on page load ?

Hello Jean-Philippe,

Please try to use Load event instead of Page show.

Jean-Philippe Steck
Posts: 0
Joined: Sat Nov 30, 2013 11:09 am

How to avoid refresh delay when reading data on page load ?

The page is not refreshed with Load Event : the invoke service action seems to be called only the very first time.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to avoid refresh delay when reading data on page load ?

Load event is only fired once, when the page is loaded into the DOM. When you navigate to the page and the page is already in the browser, then the event won't be fired. An alternative is to use page show event.

You see the previous values on the page because when you navigate to the page, the page currently in the DOM (with old values) is shown. A second or two later, the page is updated with new values after service invocation.

Return to “Issues”