This topic is locked
[SOLVED]

 Multi-User Dashboard refresh

1/8/2021 3:05:16 AM
PHPRunner General questions
C
ckranich authorDevClub member

Hello All,
I have a multi user application where multiple users have dashboard views

open all time. When in one of the dashboard tables one user adds a record

this is only seen at the others after a F5 global refresh...
(I am aware of the auto-refresh feature of the dashboard, but this disables

any edit function)
How do/did you handle this?

(or did you avoid this by cleverer design?)
kind greeting & stay safe and heathy

(in times of pandemic)
ckranich

Admin 1/9/2021

You can write your own code that will reload either the whole page or just some elements.
To reload the whole page use location.reload();

To reload some dashboard elements check this article:

https://xlinesoft.com/phprunner/docs/how_to_reload_a_page.htm
And to implement the page refresh after a certain period of time you need to use setTimeout function:

https://javascript.info/settimeout-setinterval

C
ckranich authorDevClub member 1/9/2021



You can write your own code that will reload either the whole page or just some elements.
To reload the whole page use location.reload();

To reload some dashboard elements check this article:

https://xlinesoft.com/phprunner/docs/how_to_reload_a_page.htm
And to implement the page refresh after a certain period of time you need to use setTimeout function:

https://javascript.info/settimeout-setinterval


Hi Sergey,
Thank you for your suggestions!
Yes I followed allredy your first link

(Example 2: Reload a page that belongs to another table:

    1. get handle to PageObject in Javascript OnLoad (=> window.myListPageObject)


    1. Use this for a (still manual) refresh of just this list page (part of dashboard)
      For the timed reload I currently use a 'refresh' table (fields 'tablename' and 'timestamp of last update')

      This is included to dashboard too, still visible (will be hidded later on) and is set to refresh every 15 secs.
      To automate the step #2 (clicking on 'refresh' button, how can I do this (Controlled by PHP (one of the PHP reload Events, every 15 secs))?

      I know that I cannot call JS(in the Browser) via PHP (on the server). Is there any chance to include any Control.On() function in the

      JS part of the webpage to 'remote controlled from PHP' fire a click action to then fire the

      if( window.myListPageObject ) {

      window.myListPageObject.reload({a:'reload'});

      }

      (which would be the equivalent of as manual click then)
      Can I use the setProxyValue() on the server PHP to alter a variable on the JS side in the Browser

      and having a function in place (contained in the Javascript OnLoad) that watches on this variable

      and then fires the window.myListPageObject.reload({a:'reload'}) or any othe Click action on the Button?
      if I do a "simple" reload by a JS timeout function, does that interfere with any editing process

      (popup or inline) of the list table?
      Kind Regards,
      ckranich



C
ckranich authorDevClub member 1/9/2021



Hi Sergey,
Thank you for your suggestions!
Yes I followed allredy your first link

(Example 2: Reload a page that belongs to another table:

    1. get handle to PageObject in Javascript OnLoad (=> window.myListPageObject)


    1. Use this for a (still manual) refresh of just this list page (part of dashboard)
      For the timed reload I currently use a 'refresh' table (fields 'tablename' and 'timestamp of last update')

      This is included to dashboard too, still visible (will be hidded later on) and is set to refresh every 15 secs.
      To automate the step #2 (clicking on 'refresh' button, how can I do this (Controlled by PHP (one of the PHP reload Events, every 15 secs))?

      I know that I cannot call JS(in the Browser) via PHP (on the server). Is there any chance to include any Control.On() function in the

      JS part of the webpage to 'remote controlled from PHP' fire a click action to then fire the

      if( window.myListPageObject ) {

      window.myListPageObject.reload({a:'reload'});

      }

      (which would be the equivalent of as manual click then)
      Can I use the setProxyValue() on the server PHP to alter a variable on the JS side in the Browser

      and having a function in place (contained in the Javascript OnLoad) that watches on this variable

      and then fires the window.myListPageObject.reload({a:'reload'}) or any othe Click action on the Button?
      if I do a "simple" reload by a JS timeout function, does that interfere with any editing process

      (popup or inline) of the list table?
      Kind Regards,
      ckranich




the JS timeout function works OK for me.

(Still the database and multi-user things stay(locking etc.) but this is a non web application general theme...)
Sorry, sometimes I tend to look for too complicated ways..

I will mark it as SOLVED
BTW: for any special problems in future, would there any way to trigger something on the Client side

by an PHP event?
Kind Greetings,
ckranich