Jump to content

Focus goes from the component


Mediv

Recommended Posts

Hi Farhad.

Very interesting situation. Took your demo example with fish, added the button (Click) and my form, grid tied with ClientDataSet.

In the form of context-sensitive search is implemented, the OnKeyDown event on the component TUniEdit put filters on ClientDataSet.

The sequence of actions for which the focus is lost from the component TUniEdit:

1. I type in the box for example "sna", filtered 3 records. All is well.

2. Box is cleared, a complete list. all is well.

3. I type "sn", filtered multiple entries, do click on the grid, and then put the cursor in the TUniEdit and add character "a",

is filtered out 3 records, but the focus away from the component! continue to type the text in the box does not work,

you need to constantly move the cursor to TUniEdit!!!!!!!!

FishFactsTest.zip

Link to comment
Share on other sites

Hi,

 

The issue starts when once the grid gets focused, the workaround I found is :

procedure TUniForm1.UniEditAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);
begin
  UniEdit.SetFocus;
end;

procedure TUniForm1.Grid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);
begin
  UniEdit.SetFocus;
end;

 

with this, UniEdit always remains focused..

 

Regards

Link to comment
Share on other sites

Hi,

 

The issue starts when once the grid gets focused, the workaround I found is :

procedure TUniForm1.UniEditAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);
begin
  UniEdit.SetFocus;
end;

procedure TUniForm1.Grid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);
begin
  UniEdit.SetFocus;
end;

 

with this, UniEdit always remains focused..

 

Regards

 

 

Thanks, helped.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...