Form update of all connected sessions - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Form update of all connected sessions (/thread-871.html) |
Form update of all connected sessions - cyracks - 12-15-2018 Hello I have a use case when action in one form must refresh form components in all connected sessions. I can successfully update form components, but changes are not seen until web browser windows is refreshed (F5). Executing WebApplication.ShowMessage properly pops up a message in all connected sessions. Code: procedure TFormMain.pRefreshForm; Please advise me if it is possible to execute refresh of all active forms bound to one web server. ps: I am using IW 1.4 and cgdevtools components 14.2. Regards, Tomaž RE: Form update of all connected sessions - kudzu - 12-17-2018 To do this you need to put an async timer on each form that might be open at the time and check for updates in that event. Browsers do not support push notifications as it creates a lot of load on the webservers. There are JS libs to "hack" it but they have side effects. For now an universal compatibility, the timer is probably the best route but you will have to do it to each and every form that might be visible at the time and dont make the timing too short else you will also create a load for the server. RE: Form update of all connected sessions - cyracks - 12-17-2018 I tried to add timer on form and start it in procedure pRefreshForm, but it had no effect. If I understand correctly you advise me to add a timer on a form and set it to be enabled all the time ? That is a problem because update frequency should be 1 second or 1 hour, depending on the situation. We would like to monitor entrances to the building where user image is displayed to the receptionist each time a person checks in. So frequency should be 1 second in peak time, when a lot of people are coming to the building and much less otherwise. Any other idea ? ps: how come that webapplication.showmessage is shown ? Regards, Tomaž RE: Form update of all connected sessions - DanBarclay - 12-18-2018 (12-17-2018, 09:23 PM)cyracks Wrote: I tried to add timer on form and start it in procedure pRefreshForm, but it had no effect. If I understand correctly you advise me to add a timer on a form and set it to be enabled all the time ? That is a problem because update frequency should be 1 second or 1 hour, depending on the situation. We would like to monitor entrances to the building where user image is displayed to the receptionist each time a person checks in. So frequency should be 1 second in peak time, when a lot of people are coming to the building and much less otherwise. Does this work in the async procedure? Code: for i := 0 to ControlCount - 1 do Another suggestion: Code: js: string; Both from Alex some time back. I haven't needed them so haven't tried. Dan RE: Form update of all connected sessions - Alexandre Machado - 01-11-2019 How many concurrent sessions do you have? IWMonitor component was designed to do things like that. IWMonitor watches a certain flag in WebApplication. When the flag is set, it triggers an action (which can be a page refresh, for instance). IWMonitor is lightweight (much more than the IWTimer) so it should be OK to use it even in 1 second intervals. |