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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...