View Issue Details

IDProjectCategoryView StatusLast Update
0005041JEDI VCL00 JVCL Componentspublic2011-06-10 16:10
ReporterVideoRipperAssigned ToAHUser 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.33 
Target VersionFixed in Version3.40 
Summary0005041: TJvDBFindEdit: FTimer triggers after ResetFilter
DescriptionWhen 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 InformationI 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.
TagsNo tags attached.

Activities

obones

2009-12-04 15:30

administrator   ~0016949

Please send us the zipped sources of a sample application showing this

2009-12-04 16:19

 

Jedi-5041.zip (6,659 bytes)

VideoRipper

2009-12-04 16:20

reporter   ~0016966

Sample application and modified version of "JvDBFindEdit.pas" attached.

AHUser

2010-06-07 16:19

developer   ~0017464

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-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