Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forcing a refresh
#5
To trigger a page refresh in Intraweb, you can use the following code in the timer's OnTimer event:

delphi
Copy code
WebApplication.CallBackResponse.AddJavaScriptToExecute('location.reload();');
This code will execute the JavaScript location.reload() function, which refreshes the current page.

Alternatively, you can use the WebApplication.Synchronize method to execute the refresh code on the main thread:

delphi
Copy code
WebApplication.Synchronize(procedure begin
  WebApplication.ShowMessage('Refreshing page...');
  WebApplication.UpdateSession;
end);
This code displays a message to the user, updates the session state, and refreshes the page.

In both cases, the code should be placed in the timer's OnTimer event, which is triggered every minute to check if the data has changed and requires a page refresh. bluey
Reply


Messages In This Thread
Forcing a refresh - by JimCater - 12-12-2022, 02:42 AM
RE: Forcing a refresh - by jeroen.rottink - 12-13-2022, 08:57 PM
RE: Forcing a refresh - by JimCater - 12-14-2022, 08:12 PM
RE: Forcing a refresh - by jeroen.rottink - 12-14-2022, 08:41 PM
RE: Forcing a refresh - by emmaorabelle - 04-19-2023, 06:42 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)