Async events in ContentRegion

I have on a form one TIWButton, one TTIWAdvMessageDlg, and one TIWRegion. The region contains one TIWEdit.

I have assigned the region to the ContentRegion property of the message dialog. I have assigned an event handler to the OnAsyncKeyDown event of the IWEdit. This event handler is empty (except for //).

In the OnClick handler of the button I call the Show method of the dialog box.

When I run this and click the button, the message dialog displays, but when I type in the edit box it accepts only one keypress and then the focus is immediately redirected to the OK button of the dialog box.

If I remove the AsyncKeyDown event of the edit it works as expected. However I wish to put some verification code in this event handler if I can get it to work.

Is there some setting I need to change to make this work properly?

The problem is to do with these lines in function TTIWAdvMessageDialog.RenderAsync. They are causing the dialog box to be redrawn and thus focus returns to the default control.

    if ShowDialog then
    begin
      js := js + HTMLName + 'Show();'#13;
      js := js + HTMLName + 'RePosition();'#13;
      js := js + HTMLName + 'Focus();'#13;
    end;

We'll investigate this.

Hi Bruno,

Is it possible to get an update on progress please?

Thanks.

Next update will have an extra option with which this problem can be solved. We'll release this next week.

Thank you. I have installed V5.1.2 and the problem is resolved. For the benefit of others who may have this same problem, it is necessary to set the AsyncUpdateRequired flag to false in the async event handler.

For example:


procedure TIWForm1.edt1AsyncKeyDown(Sender: TObject; EventParams: TStringList);
begin
  iwDlg1.AsyncUpdateRequired := False;
end;