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
0005041 [JEDI VCL] 00 JVCL Components feature always 2009-12-02 21:18 2011-06-10 16:10
Reporter VideoRipper View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.33
Summary 0005041: TJvDBFindEdit: FTimer triggers after ResetFilter
Description When a user searches for a particular record in a TDataSet using a TJvDBFindEdit
and there are matches, those records are shown as expected.
When the user clears the filter (using .ResetFilter), the dataset jumps to the first
record in the (unfiltered) dataset, which is also as expected.

However, it would be nice if, when a certain record is selected in the dataset
and the filter is reset, the selected record stays the selected one.
Additional Information I thought I could do it like this:
[CODE]
MyFindEdit.FindMode := fmAnyPos;
MyFindEdit.FindStyle := fsFilter;

//

procedure TDataForm.ActionFindClearExecute(Sender: TObject);
Var
  B : TBookmark;
begin
  B := MyTable.GetBookmark;
  Try
    MyFindEdit.ResetFilter;
    MyTable.GotoBookmark(B);
  Finally
    MyTable.FreeBookmark(B);
  End;
end;
[/CODE]

Unfortunately, this doesn't seem to work: since the overriden "Change"-procedure
is called after resetting the filter, FTimer is enabled and the dataset jumps to
the first record when the timer is triggered.

It would be nice if the timer is not triggered, so that the bookmarked record is
selected after the reset.

I added a small published procedure that enables me to disable the timer when desired,
though it actually is a quick hack; maybe a better solution can be found.

[CODE JvDBFindEdit.pas]
Type
  TJvDBFindEdit = class(TJvMaskEdit)
//
  public
//
    Procedure DisableTimer;
//
  End;
//
Implementation
//
Procedure TJvDBFindEdit.DisableTimer;
Begin
  FTimer.Enabled := False;
End;
//
End.
[/CODE]

Now I can really jump to the selected record after a .ResetFilter:
[CODE]
MyFindEdit.FindMode := fmAnyPos;
MyFindEdit.FindStyle := fsFilter;

//

procedure TDataForm.ActionFindClearExecute(Sender: TObject);
Var
  B : TBookmark;
begin
  B := MyTable.GetBookmark;
  Try
    MyFindEdit.ResetFilter;
    MyFindEdit.DisableTimer;
    MyTable.GotoBookmark(B);
  Finally
    MyTable.FreeBookmark(B);
  End;
end;
[/CODE]

Greetz,

Peter.
Tags No tags attached.
Attached Files zip file icon Jedi-5041.zip [^] (6,659 bytes) 2009-12-04 16:19

- Relationships

-  Notes
(0016949)
obones (administrator)
2009-12-04 15:30

Please send us the zipped sources of a sample application showing this
(0016966)
VideoRipper (reporter)
2009-12-04 16:20

Sample application and modified version of "JvDBFindEdit.pas" attached.
(0017464)
AHUser (developer)
2010-06-07 16:19

Fixed in SVN revision 12793

The ResetFilter() function doesn't trigger the timer anymore. If the developer explicitly wants to reset the filter he should get what he wants immediately.

- Issue History
Date Modified Username Field Change
2009-12-02 21:18 VideoRipper New Issue
2009-12-02 21:20 VideoRipper Issue Monitored: VideoRipper
2009-12-04 15:30 obones Note Added: 0016949
2009-12-04 15:30 obones Status new => feedback
2009-12-04 16:19 VideoRipper File Added: Jedi-5041.zip
2009-12-04 16:20 VideoRipper Note Added: 0016966
2010-06-07 13:55 obones Status feedback => acknowledged
2010-06-07 16:19 AHUser Note Added: 0017464
2010-06-07 16:19 AHUser Status acknowledged => resolved
2010-06-07 16:19 AHUser Fixed in Version => Daily / SVN
2010-06-07 16:19 AHUser Resolution open => fixed
2010-06-07 16:19 AHUser Assigned To => AHUser
2011-06-10 16:10 obones Fixed in Version Daily / SVN => 3.40


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