Question

Page 1 is a summary of Page 2, I need to refresh Page 1 when I change Page 2's data. I see the old values on Page 1 when I use jQT.goBack().

Was it helpful?

Solution

jQTouch enables a single HTML page to act like a web app. The "back" page is really just another section of the HTML page.

Tapping the Back button animates the page back to a previous section. If the content should be refreshed, then you can register a listener for page event, and perform ajax to refresh the page. Here is code example:

  $('#page_back_to').bind('pageAnimationStart', function(page, info) {
    if (info.direction == 'in' && info.back) {
      // insert your code here to replace the content
    }
  });

OTHER TIPS

If you have two page, Page1 and Page2, and see them with the same order, and then on Page2 you save some data that affect the Page1, then you have two solutions.

First way

From Page2, when you go "back" to page 1, you go not with the "goback" but with a link that have an extra unique parameter, eg the time stamp of the the update, and this force Page1 to reload.

Eg: you go back as: Page1.aspx?timestamp=299388172

Second way

On the Page1 you set a cache of few seconds only, eg the seconds that you may think that the user takes to make the edit, and you take care to be reloaded after that time. You do not set cache on browser for ever.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top