Page 1 of 1

ShowMessage and SetFocus

PostPosted: 13 Feb 2019 02:32
by sbsllc
In my application I call showmessage then setfocus like this:

procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);
begin
WebApplication.ShowMessage('Show Message');
IWCGJQEdit1.SetFocus;
end;

Previously this would show the message and set focus on the edit field but at some point this stopped working and the edit field never receives focus. I noticed this after updating to version 4.1.0.156. With the above example should the edit field receive focus?

Re: ShowMessage and SetFocus

PostPosted: 13 Feb 2019 10:33
by Alexander Bulei
Hi sbsllc,

Code: Select all
procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);
begin
WebApplication.ShowMessage('Show Message');
IWCGJQEdit1.SetFocus;
end;


Previously this would show the message and set focus on the edit field but at some point this stopped working and the edit field never receives focus. I noticed this after updating to version 4.1.0.156.


Please, don't start with that things "after update, stop working" ...It's never works, and can't work like this...
The edit will lose the focus in favor of message/button, also for any element which was clicked.

Re: ShowMessage and SetFocus

PostPosted: 13 Feb 2019 15:23
by sbsllc
Alexander, your right. I should have worded things differently and I see now where i was confused about how things were working with my application. A new day looking at things with fresh eyes did the trick.