Page 1 of 1

IWCGCreateMessageDialog Auto...

PostPosted: 02 Oct 2014 14:03
by etwoss
HI

using this code:
Code: Select all
procedure TIWForm8.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
  AParams: TStringList);

var
  Dlg : TIWCGJQMsgDialog;
  LMessage: String;
begin
  LMessage := 'Are you sure you want to cancel request for product ''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ss ss'' ?';

  Dlg := IWCGCreateMessageDialog('', mtConfirmation, [mbYes,mbNo],
    procedure(Dialog: TIWCGJQMsgDialog; AResult: TModalResult)
    begin
      if AResult = mrYes then
      begin
      end;

  end);

  Dlg.Message := LMessage;
  Dlg.JQDialogOptions.AutoHeight := True;
  Dlg.JQDialogOptions.AutoWidth := True;
  Dlg.JQDialogOptions.Closable := False;
  Dlg.JQDialogOptions.Resizable := False;

  Dlg.JQDialogOptions.OnClose.OnEvent := DialogClose;
  Dlg.AjaxReRender();


I expected that the dialogs height and width are big enough to Show the long message, but its not , its still standard size

Am i missing some property?

Eric

Re: IWCGCreateMessageDialog Auto...

PostPosted: 02 Oct 2014 14:09
by etwoss
Hi

Hmmm... when i set


Dlg.JQDialogOptions.Height := 175;
Dlg.JQDialogOptions.Width := 750;

The message it still in 4 lines.

It works fine if i set

Dlg.Height := 175;
Dlg.Width := 750;

Eric

Re: IWCGCreateMessageDialog Auto...

PostPosted: 02 Oct 2014 14:37
by Jorge Sousa
Hi

If you investigate how jqueryui Dialog.AutoWidth and Dialog.AutoHeight, work, it automatically calculates the height,

so you shouldnt render any particular width or height, ie, StyleRenderOptions.RenderSize should be False.

Re: IWCGCreateMessageDialog Auto...

PostPosted: 02 Oct 2014 15:14
by Alexander Bulei
Hi Eric,

We have fixed the AutoWidth property in JQDialog:

v2.3.0.58:

IWCGJQDialog
- Fixed: AutoWidth property


Note

But there is an important thing, you MUST set the message AFTER the definition of dialog (options).




Here you have the your changed code:

delphi code
procedure TIWForm8.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);

var
Dlg : TIWCGJQMsgDialog;
LMessage: String;
begin
LMessage := 'Are you sure you want to cancel request for product ''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ss ss'' ?';

Dlg := IWCGCreateMessageDialog('', mtConfirmation, [mbYes,mbNo],
procedure(Dialog: TIWCGJQMsgDialog; AResult: TModalResult)
begin
if AResult = mrYes then
begin
end;

end);


// Dlg.JQDialogOptions.Closable := False; // <- check documentation
Dlg.JQDialogOptions.ShowCloseIcon:= False;
Dlg.JQDialogOptions.Resizable := False;
Dlg.JQDialogOptions.AutoHeight := True;
Dlg.JQDialogOptions.AutoWidth := True;
Dlg.Message := LMessage;

Dlg.JQDialogOptions.OnClose.OnEvent := DialogClose;
Dlg.AjaxReRender();


Best Regards.

Re: IWCGCreateMessageDialog Auto...

PostPosted: 03 Oct 2014 07:38
by etwoss
Thanks!