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,
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.
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 also include the following information: