Auto Browser Refresh (is it Possible)?

Topics related to AppGini plugins/add-ons go here.
Post Reply
ozcpa
Posts: 6
Joined: 2022-01-13 00:57

Auto Browser Refresh (is it Possible)?

Post by ozcpa » 2022-02-01 00:19

I own the latest version of AppGini and ALL available "add-ons" ([plugins).

I have setup an AppGini system which includes a simple table for messages.

This message table is used by different users to send “text” messages to each other,

When (say) two users are logged in to the system, each will see the list of messages. However, if a user adds a message, other users will NOT see that message until they do a “screen refresh” on their browser,

My question is whether it is possible to force a regular screen refresh so that the messages update on each users screen regularly?

I would like to achieve this from the SERVER so that each user doesn't need to install anything at "their end".

I have integrated Appgini Javascript Helper into my simple App and this allows the message “numbers” to update in almost real-time (using an SQL COUNT statement). However, even though the toolbar (generated by Javascript Helper) shows status updates without the need for a user to do a browser "refresh", the actual screen in total (i.e. where the messages appear) doesn’t update until a user refreshes their page.

Is what I want to each possible (and how, if it is).

Much appreciate any help that someone would be generous enough to provide.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1813
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Auto Browser Refresh (is it Possible)?

Post by jsetzer » 2022-02-01 05:01

Good morning,

you can check out if this function can help:

Code: Select all

// file: hooks/TABLENAME-dv.js
AppGiniHelper.Common.autoReload(60, 10);
This will automatically create a counter progress bar at the bottom left corner like this one:

uOQEaqodVz.png
uOQEaqodVz.png (939 Bytes) Viewed 1618 times

As soon as you move the mouse or use keyboard, the counter will reset. You can stop the timer or reload the page using the buttons.

First parameter: (here: 60) = interval in seconds, for example 60 seconds.
Second parameter: (here: 10) = 10 seconds before reload the green bar will turn red

s4rvqZjbUK.png
s4rvqZjbUK.png (601 Bytes) Viewed 1618 times



Screenrecording
Attachments
chrome_48ePe85mZt.gif
chrome_48ePe85mZt.gif (25.06 KiB) Viewed 1618 times
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

ozcpa
Posts: 6
Joined: 2022-01-13 00:57

Re: Auto Browser Refresh (is it Possible)?

Post by ozcpa » 2022-02-01 07:20

Thanks Jan for the great ideas that you have offered. MANY thanks.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1813
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Auto Browser Refresh (is it Possible)?

Post by jsetzer » 2022-02-02 09:54

By the way: Of course you can use the autoReload() function in table view, too. But please remember that Table View (TV) behaves slightly different from Detail View: We will have to wait for the page to be loaded completely. See the following samples:

AutoReload in Table View (TV)

Code: Select all

// file: hooks/TABLENAME-tv.js
$j(document).ready(function () {
    AppGiniHelper.Common.autoReload(60, 10);
});
AutoReload in Detail View (DV)

Code: Select all

// file: hooks/TABLENAME-dv.js
AppGiniHelper.Common.autoReload(60, 10);
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
pilandros
Veteran Member
Posts: 93
Joined: 2014-02-13 18:19

Re: Auto Browser Refresh (is it Possible)?

Post by pilandros » 2022-03-31 20:42

Does this interesting request of yours, is covered and completed with the new Messages plugin?

Post Reply