Page 1 of 1

Force page refresh

Posted: Sun Jul 28, 2013 10:41 pm
by Yaniv

Hi,
On my application I have a page that contains a list of topics, while the user select one of them I'm loading next screen and fetching the data based on the user selection (each topic has its own URL to get it's XML response).
The issue is that the page is shown with previous data till response get back from server and populating the "updated" data.
I checked the solution that gave for this in this forum but it now worked out, can you suggests? (I'm not using full refresh and all pages render in a single file).
Application is shared with you (a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a, applciation name: ShuvaIsrael).

p.s. In case required, this can be tested on mobile only since the XML response contains blank charters at the start and cause parser error on tester but working fine on device.


Force page refresh

Posted: Mon Jul 29, 2013 6:03 am
by Maryna Brodina

Hello! Hello! Working on it, I'll update.


Force page refresh

Posted: Mon Jul 29, 2013 8:30 am
by Maryna Brodina

As we can see from shared app you use "Render all pages in one HTML file". You can refresh fields on page Show event using JS. This action should be before service invocation.


Force page refresh

Posted: Mon Jul 29, 2013 9:21 am
by Yaniv

Correct! But in this case that page will be show with previous data, data will be cleaned and than the retrieved information will be presented. Means that the user will see all above on screen.
Any other option?


Force page refresh

Posted: Mon Jul 29, 2013 1:58 pm
by Maryna Brodina

As you have checked "Render all pages in one HTML file" you can refresh fields when you leave the page. You can use Page Hide action. Note that you can't use codeAppery("componentName")/code with this event because it searches on current page. Use code$("[dsid=componentName]")/code instead


Force page refresh

Posted: Wed Jul 31, 2013 8:33 pm
by Yaniv

Working great, Thanks!


Force page refresh

Posted: Sat May 10, 2014 9:42 pm
by Alex GG

Hi!

I ́m tryng to refresh fields whrn leave the page. It worked fine with labels, but how to refresh image component?

I tried this:
$("[dsid=mabileimage_249]").attr('src');

and this:
$("[dsid=mabileimage_249]").attr('src',Appery.getImagePath('addfavorites.png'))

it is still showing last image when another item is click on the master page...

Regards