04-30-2021, 01:29 PM
We often use async events, but it happens from time to time that we have to refresh the whole page in certain cases - as a result of an asnyc event.
Can that be done in any way?
Can that be done in any way?
procedure TDlgBase.TriggerFullPostFromAsyncEvent;
var js: string;
begin
// https://forums.embarcadero.com/thread.jspa?messageID=675140򤵄
js := 'location.reload();';
WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA(js);
end;
(05-10-2021, 09:02 AM)jeroen.rottink Wrote: [ -> ]Following works for me. Call it from your Async... event
Code:procedure TDlgBase.TriggerFullPostFromAsyncEvent;
var js: string;
begin
// https://forums.embarcadero.com/thread.jspa?messageID=675140򤵄
js := 'location.reload();';
WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA(js);
end;
procedure TDlgBase.TriggerFullPostFromAsyncEvent;
var js: string;
begin
js := 'location.reload(true);';
WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA(js);
end;
(05-19-2021, 01:19 AM)Alexandre Machado Wrote: [ -> ]We are adding a new method to TIWForm which will do this automagically. You just need to call
IWForm.ReloadAsync;
and it will take care of that for you.
Cheers
(05-19-2021, 05:30 AM)jeroen.rottink Wrote: [ -> ](05-19-2021, 01:19 AM)Alexandre Machado Wrote: [ -> ]We are adding a new method to TIWForm which will do this automagically. You just need to call
IWForm.ReloadAsync;
and it will take care of that for you.
Cheers
Hi Alexandre,
Nice but please check if reload() still should take a parameter. See https://stackoverflow.com/questions/5512...deprecated
Kind regards,
Jeroen.