I have a menu/list page (see screenshot) which links to several other pages. If I click on “2 images” on the top line, I go to a second SPA page where I can upload images. The “2 images” comes from a COUNT() in the DB query.
So if I go to the second page, upload an image, and return to this menu page, the “2 images” should update to “3 images” but it does not.
From the update page I can press the browser’s ‘back’ button, press my own ‘back’ button or go through the menus to get to the menu page but in all instances the menu page does not update.
The only way to update it is by pressing F5 to refresh the page. How can I get the menu page to update automatically?
1: Why don’t you put the file upload into a Modal and then on upload of the image, simply add a data refresh on upload success
2: Add a schedule to do a refresh on the data base.
3: On the file upload add a session value for say ‘Upload-Refresh = 1’ and then on the data page you go back to add a refresh if value = 1 (after the refresh set the value to 0) this way it is only refreshing when the value is set.
Hi @Teodor, sorry to bother you directly, I was wondering if you could confirm that Peter’s suggestion number 3 is the best option or if there is a better way.
I don’t understand you sorry. Are you refreshing the upload action with this sc_upload_img_pq.load({job_id: query.job_id},true);? Or what is it doing?>
You need to reload the server action which lists the COUNT on the page …
Interesting. I wouldn’t have thought of that. It does make sense.
I have moved the Server Connect (the FileUpload one) from the SPA include page to the parent page. I have then selected the same Server Connect and created a Success Dynamic Event where I have selected the listings Server Connect:sc_q_live_reports LOAD action.
Saved everything. Refreshed. Cleared Cached Images and Files.
But the listings page still does not update. What am I doing wrong?
Am I moving the wrong Server Action to the parent page?
*** EDIT ***
That was it, I moved the Sever Connect for the listings page to the parent page.
This now works.
Many thanks @Teodor, I wouldn’t have got there without your help
Cheers
I don't know, names like sc_q_live_reports tell me nothing really.
You need to move the action used to list your records to the main page ... that is the one you want to reload. Upload hs nothing to do with showing data on the page ....