Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004350 [JEDI VCL] 00 JVCL Components minor always 2008-03-03 19:49 2008-03-04 04:25
Reporter jay View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.32
Summary 0004350: TJvUltimGrid Search "Focus Error" when searching records and grid is not visible.
Description On an application, I usually have a panel where the user can type text that will be searched incrementally (using the grids Search function). Below that, I have a page control that has one page with the the data in a grid (TJvUltimGrid Component) and another page where the current record is displayed in a Form View.

When the "Grid page" is displayed, the search is done correctly, the correct record is found and the cursor an the grid is visible on the current record.

The problem is when the "From view" page is displayed instead of the "grid page". In this case I get an error that a not visible control cannot be focused. If I set the "Focus" parameter of the function to False, the search does not seem to work and the record is not positioned accordingly.

The functions source code is:

function TJvDBUltimGrid.Search(const ValueToSearch: Variant; var ResultCol: Integer;
  var ResultField: TField; const CaseSensitive, WholeFieldOnly, Focus: Boolean): Boolean;
begin
  Result := False;
  if (SearchFields.Count > 0) and (ValueToSearch <> Null) and (ValueToSearch <> '') then
  begin
    FValueToSearch := ValueToSearch;
    Result := PrivateSearch(ResultCol, ResultField, CaseSensitive, WholeFieldOnly, False);
    if Result and Focus then
    begin
      Self.Col := ResultCol;
      if Self.Visible then
        Self.SetFocus;
    end
    else
      RestoreGridPosition;
  end;
end;

If I change the Line:

      if Self.Visible then

to

      if Self.Visible and Self.CanFocus then

then it all works correctly as it should.

If this code change does not break any other thing that I am not aware of, could you please add this minor change to the next version?

Regards,
Jose Ostos

Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0014270)
obones (administrator)
2008-03-04 04:24

This is now added in SVN (r11746)

- Issue History
Date Modified Username Field Change
2008-03-03 19:49 jay New Issue
2008-03-04 04:24 obones Status new => resolved
2008-03-04 04:24 obones Fixed in Version => Daily / SVN
2008-03-04 04:24 obones Resolution open => fixed
2008-03-04 04:24 obones Assigned To => obones
2008-03-04 04:24 obones Note Added: 0014270


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker