12-15-2018, 09:30 AM
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.
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ž
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;
begin
WebApplication.ShowMessage('Session message'); // this message shown
RegionMain.AjaxReRender();
end;
var LSessions : TList;
LSession : TIWApplication;
i : Integer;
begin
LSessions := GSessions.LockList;
try
for i := 0 to Pred(LSessions.Count) do begin
LSession := LSessions[i];
LSession.Lock;
try
// to-do: check which form is opened
TFormMain(LSession.ActiveForm).ImageUser.Picture.Url := 'xxx';
TFormMain(LSession.ActiveForm).EditName.Text := 'User Name';
TFormMain(LSession.ActiveForm).pRefreshForm; // message is shown, but form is not refreshed
// TFormMain(LSession.ActiveForm).Update; // does not work
// TFormMain(LSession.ActiveForm).Refresh; // does not work
finally
LSession.Unlock;
// LSession.Redirect('http://127.0.0.1',True); // does not work
LSession := nil;
end;
end;
finally
GSessions.UnLockList(LSessions);
end;
end;
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ž