Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New demo has been published
#3
(07-11-2023, 08:52 AM)Blanca80 Wrote: Hello, 

Related to this question if i have got a callback called by showconfirm instruction, how can tell the ajax call to show the locker?
Thank you very much.

Blanca

Hi Blanca,

that's a good question.

Here's how:

Code:
procedure TIWForm1.ShowConfirmationWithCallback(const Msg: string);
var
  jsCallbackCode: string;
begin
  jsCallbackCode := 'javascript:ajaxCall(''MyConfirmCallback'', '''', {text:''Please wait until MyConfirmCallback returns''});';
  WebApplication.ShowConfirm(Msg, jsCallbackCode, Title, 'Yes', 'No');
end;

basically you call ShowConfirm() the same way, but instead of passing the callback method name (the Delphi callback registered previously), you pass the actual code (JavaScript) that will execute the callback call, preceded by a "javascript:" prefix.

I'll update our NewDialogs demo to show a case like this.

Please notice that the js callback code is using single quotes as JavaScript string delimiter. That's because internally our code is not escaping the double quotes (Something that I'll fix).

Cheers
Reply


Messages In This Thread
RE: New demo has been published - by Blanca80 - 07-11-2023, 08:52 AM
RE: New demo has been published - by Alexandre Machado - 07-11-2023, 09:58 PM
RE: New demo has been published - by Blanca80 - 07-12-2023, 06:57 AM
RE: New demo has been published - by Blanca80 - 05-20-2024, 02:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)