Hello (mterceno co-worker here ;-) )
It seems that adding the "false" parameter to the ajaxRequest method ensure that the code in OnAjaxEvent() is executed before any other client-side request.
But the problem is that all CS requests made during the process (mouse clics, keyboard inputs, ... queued I guess) are still executed after the OnAjaxEvent() code is done.
How could we stop the UI from catching all events during OnAjaxEvent() execution?
I tried this approach (using a mask) to no avail (simple test with a button click):
JS:
function click(sender, e, eOpts)
{
MainForm.form.showMask();
ajaxRequest(sender, 'myclickevent', [], false);
}
Delphi:
procedure TPurchaseEntriesFrame.UniButtonTestAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
inherited;
if EventName = 'myclickevent' then
try
UniLabel7.Caption := UniLabel7.Caption + ' myclickevent';
Sleep(1000);
finally
UniSession.AddJS('MainForm.form.hideMask();');
end;
end;
For example, if the user clicks on the button again while UniButtonTestAjaxEvent() is performed, the second click event is still catched and fired after. (mask is not shown)