Hi eosventas,
This happens because you need re-render the dialog.
TCollection's (JQDialogOptions.Buttons) doesn't supports ajax change, so you need call AjaxReRender method.
Almost all properties in JQ<component_name>Options supports changing in asynchronous.
Other thing, you don't need define the AutoOpen property, dialog uses it only on page render.
In your case you need put the AjaxReRender on both procedures:
delphi code
procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);
var iButtom: TIWCGJQCustomDialogButton;
begin
IWCGJQLabel1.Caption := 'This Dialog has TWO buttons';
with IWCGJQDialog1 do
begin
//JQDialogOptions.AutoOpen:= True; // USELESS IN THIS CASE
JQDialogOptions.Buttons.Clear;
JQDialogOptions.Title:= 'Any Title';
JQDialogOptions.Modal:= True;
Visible:= True;
iButtom:= JQDialogOptions.Buttons.Add;
iButtom.Text:= 'first choice';
iButtom:= JQDialogOptions.Buttons.Add;
iButtom.Text:= 'second choice';
// RE-RENDER THE DIALOG
AjaxReRender(True,False);
end;
end;
procedure TIWForm1.IWCGJQButton2JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);
begin
IWCGJQLabel1.Caption := 'This Dialog should has NO buttons at all because we use JQDialogOptions.Buttons.Clear';
with IWCGJQDialog1 do
begin
//JQDialogOptions.AutoOpen:= True; // USELESS IN THIS CASE
JQDialogOptions.Buttons.Clear; //HERE WE CLEAR THE BUTTONS
JQDialogOptions.Title:= 'Any Title';
JQDialogOptions.Modal:= True;
Visible:= True;
// RE-RENDER THE DIALOG
AjaxReRender(True,False);
end;
end;
Best Regards.