Page 1 of 1

How to reload a list after navigate to page

Posted: Tue Oct 21, 2014 3:40 pm
by Claes Dahlberg

I've got a very simple application listing products and a page for adding products. After adding a new product the focus returns to the list page but the new product doesn't get reloaded in the list. It's in the database and shows if I close the app and open up again. Can I in some way trigg a refresh of data when I "Navigate to page"?


How to reload a list after navigate to page

Posted: Tue Oct 21, 2014 6:03 pm
by Kateryna Grynko

Hi Claes,

If we understand you correctly, you call a service on page Load event, and you tick 'Render all pages in one HTML file (jQuery Mobile multi-page template)' in App Settings. Then just use Page show instead of Load event.


How to reload a list after navigate to page

Posted: Wed Oct 22, 2014 3:07 pm
by Claes Dahlberg

Hi Kateryna, thank you for your reply. I can't understand it though... What I've done is that I've got a list and above that list I've got a button "Add item" and that takes me to another page with some input fields and a submit button. When clicking the submit button I add the data to the database and then "navigate" to the list page but this is not refreshed and the new item is not listed. If I close the app and open it again the new item is in the list. Can I trig a java script to update the list after navigation? Kindest regards Claes


How to reload a list after navigate to page

Posted: Wed Oct 22, 2014 4:42 pm
by Kateryna Grynko

Hi Claes,

How do you update this list? Do you use a service to do it? On what event do you call it?


How to reload a list after navigate to page

Posted: Wed Oct 22, 2014 4:56 pm
by Claes Dahlberg

Hi again, the list is populated by a service loading data from a database.
/Claes


How to reload a list after navigate to page

Posted: Wed Oct 22, 2014 6:12 pm
by Kateryna Grynko

Hi Claes,

On what event do you call the service?


How to reload a list after navigate to page

Posted: Mon Nov 03, 2014 10:52 am
by Claes Dahlberg

Hi Kateryna, sorry for my late response.

What I'm doing is to have a list with items. I also have a button for registering new items taking me to another page with item registration. On that page there are input fields and there's a submit button invoking a service to insert the new item with mapping as "before" and navigate back to the items list page after "success".
When I'm going back to the items list I want the new item to show in the list as it does if I close the app and open it again.

Kindest regards

Claes


How to reload a list after navigate to page

Posted: Tue Nov 04, 2014 1:23 am
by Yurii Orishchuk

Hi Claes,

You should add on your page with list - "page show" event handler with action - "invoke service" and choose service that populates your list.

See details: http://prntscr.com/52tltj/direct

Regards.


How to reload a list after navigate to page

Posted: Mon Nov 10, 2014 4:01 pm
by Claes Dahlberg

Great, thank you!