Centered positioning of TTIWAdvMessageDialog buggy

Centered positioning of TTIWAdvMessageDialog broken into two parts

Hallo,
we have a TTIWAdvMessageDialog and it's ContentRegion on a base IWRegion.

We call the "Show" method of the dialog.
When the dialogs Positon property is set to "pCentered",
the dialog is first shown in the left upper corner (1. Pos).
Then it disappears and is then shown centered (2. Pos) as we want it.

All other 8 possibilities (pTopCenter ...) are shown correctly in one step.

Can you give me advice how to solve this problem?


Kind regards

Hi,


We'll have to investigate if this behavior can be improved in a future version.
As a workaround can you try to display the dialog from an async event (for example the OnAsyncClick of an IWButton) instead of a normal event?

Hi,

that's fine. Now the dialog shows faster and positioning is Ok.
A disadvantage is that ActiveControl is no longer functioning.


procedure TIWForm1.MyAsyncClick(Sender: TObject; EventParams: TStringList);
begin
  TIWAdvMessageDlg1.FocusControl := EDIT1;
  TIWAdvMessageDlg1.Show;

  ActiveControl := TIWAdvMessageDlg1;
end;

How can we start the dialog with focus on this edit field?

Kind regards

You would have to set the FocusControl property before the AsyncClick is triggered.


Example:

procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
  TIWAdvMessageDialog1.FocusControl := 'IWEDIT1';
end;

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject;
  EventParams: TStringList);
begin
  TIWAdvMessageDialog1.Show;
end;

Thx,

I set "FocusControl" in the object inspector.
I think "ActiveControl" is to late in this event.

Example:


procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
var
  js : string;

begin
  TIWAdvMessageDialog1.ShowAsync;

  ActiveControl := TIWAdvMessageDialog1;

  js := edit1.HTMLName + 'IWCL.focus(); ';
  WebApplication.CallBackResponse.AddJavaScriptToExecute( js );
end;


It's not working!
My FocusColor (red) is displayed, but focus is missing.
If I press the "TAB" button focus is in the "edit1" field.

Kind regards

Please note that setting the ActiveControl from an async event is not supported, this is a limitation of the IntraWeb framework which we have no control over.
I haven't noticed any issues with setting the FocusControl from the object inspector.

If the problem persists, you can provide a ready to run sample project via email so I can further investigate this.
Please also include the following information:
- Version of Delphi you are using
- Version of IntraWeb you are using
- Name and version of the browser you are using