Jump to content

TUniSweetAlert Error : Blocking method Exceute () could not be called


N.Marzio

Recommended Posts

Good morning,
I'm continuing to test the various components and today I ran into this error:
Blocking method Exceute () could not be called

Running the demo project sweeta (UnisweetAlert) works ...

What could be the problem?

This is the Code:
  Try
    FSweat.AlertType: = GetAlertType (FParam.Tipo);
    FSweat.AllowEscapeKey: = False;
    FSweat.AllowOutsideClick: = false;
    FSweat.ShowCloseButton: = False;
    FSweat.ConfirmButtonText: = FParam.BtnOkTesto;
    FSweat.ShowConfirmButton: = FParam.BtnOkVisua;
    FSweat.CancelButtonText: = FParam.BtnCanTesto;
    FSweat.ShowCancelButton: = FParam.BtnCanVisua;
    FSweat.ShowLoaderOnConfirm: = FParam.ShowLoader;
    FSweat.Title: = FParam.Testo;
    //
    FSweat.OnConfirm: = cmdConfirm;
    FSweat.OnDismiss: = cmdAnulla;
    FSweat.OnPreConfirm: = cmdLoader;
    //
    if FParam.InputVisua then begin
      FSweat.InputType: = ItText;
      FSweat.InputValue: = FParam.InputValue;
    end
    else
      FSweat.InputType: = ItNone;
    //
    //
    //FSweat.show; <==== It works !!
    //
    {}
    if FSweat.Execute then begin <====== Error !!!!
      FParam.InputValue: = FSweat.InputResult;
      FParam.Result: = mrOk;
    end
    else begin
      FParam.InputValue: = '';
      FParam.Result: = mrCancel;
    end;
    {}
  finally
  End;

Link to comment
Share on other sites

The error also occurs with the component
it's at designTime on the form.

This is the code

 

  TMXUniGuiMsgParam = Record
    Testo       : String;
    ShowLoader  : Boolean;
    BtnOkVisua  : Boolean;
    BtnOkTesto  : String;
    BtnCanVisua : Boolean;
    BtnCanTesto : string;
    InputVisua  : Boolean;
    InputValue  : string;
    InputType   : TInputType;
    SleepSecond : Integer;

end;

 

procedure TxFrmBase.SweetMessage(var aParam: TMXUniGuiMsgParam);
 var
  FSweet : TUniSweetAlert;
begin
  FSweet := TUniSweetAlert.Create(Self);  // Actual Form
  Try
    FSweet.AlertType                 := TAlertType.atInfo;
    FSweet.AllowEscapeKey     := False;
    FSweet.AllowOutsideClick  := false;
    FSweet.ShowCloseButton    := False;
    FSweet.ConfirmButtonText  := aParam.BtnOkTesto;
    FSweet.ShowConfirmButton  := aParam.BtnOkVisua;
    FSweet.CancelButtonText   := aParam.BtnCanTesto;
    FSweet.ShowCancelButton   := aParam.BtnCanVisua;
    FSweet.ShowLoaderOnConfirm:= aParam.ShowLoader;
    FSweet.Title                               := aParam.Testo;
    //
    if aParam.InputVisua then begin
      FSweet.InputType  := ItText;
      FSweet.InputValue := aParam.InputValue;
    end
    else
      FSweet.InputType := ItNone;
    //
    //
    // FSweet.show; <=== OK
   //
    if FSweet.Execute then begin   <<<=============== Error Blocking
      aParam.InputValue := FSweet.InputResult;
      aParam.Result     := mrOk;
    end
    else begin
      aParam.InputValue := '';
      aParam.Result     := mrCancel;
    end;
  Finally
    FSweet.Free;
  End;

procedure TxFrmBase.ButtonExecute(Sender : TObject);

var lPar TMXUniGuiMsgParam;

begin

 ......

SweetMessage(lPar);

end;

 

Link to comment
Share on other sites

UniMainModule.EnableSynchronousOper ations was not active ...
Now works!
But by activating this switch
UniMainModule.EnableSynchronousOper ations: = True
what changes on the application, what are the benefits and what could be the limitations?

Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...