View Issue Details

IDProjectCategoryView StatusLast Update
0002725JEDI VCL00 JVCL Componentspublic2005-11-22 09:18
ReportermarcgeldonAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
Product Version2.10 
Target VersionFixed in Version 
Summary0002725: JvDBTreeVIew - Bug in procedure DeleteNode
DescriptionHello!

There is a worse bug in the procedure DeleteNode. Here is how you can produce it: mark a treenode and delete it, the selection jumps to the next treenode. BUT ONLY THE SELECTION, not the dataset!!!

As an attachment you'll receive the corrected version of JvDBTreeView.pas.


Best wishes from Germany,

Marc Geldon
(PRO IT SYSTEMS -> www.proitsystems.de)
Additional Informationprocedure TCustomJvDBTreeView.DeleteNode(Node: TTreeNode);
var
  NewSel: TTreeNode;
begin
  CheckDataSet;
  Inc(FUpdateLock);
  InDelete := True;
  try
    NewSel := FindNextNode(Selected);
    FDataLink.DataSet.Delete;
    Selected.Free;

    if NewSel <> nil then
    begin
      NewSel.Selected := True;
      // someone forgot the next line (so that also the dataset changes the "selection"
      Change2(NewSel);
    end;
  finally
    InDelete := False;
    Dec(FUpdateLock);
  end;
end;
TagsNo tags attached.

Relationships

related to 0002733 closed JvDBTreeView - ReadOnly does not work on Drag'n'Drop 
parent of 0003214 resolvedAHUser Different TJvDBTreeView bugs (with bugfix) 

Activities

2005-03-08 06:13

 

JvDBTreeView.pas (37,343 bytes)

marcgeldon

2005-03-08 12:27

reporter   ~0006656

Sorry I forgot: Why is this Bug so bad?

If a user deletes a treenode then he is on the wrong row in the dataset (the selected treenode is not for the correct row). So if the user deletes again, he deletes the root treenode (which is very bad).

With this bugfix, this does no longer happen.


Best wishes from Germany,

Marc Geldon
(PRO IT SYSTEMS -> www.proitsystems.de)

marcgeldon

2005-03-10 00:38

reporter   ~0006667

ATTENTION! In Bug No. 0002733 you'll find a edited version of JvDBTreeView. With correct DeleteNode procedure and correct DragOver procedure (Bug was that ReadOnly was ignored).

marcgeldon

2005-03-10 00:42

reporter   ~0006668

PLEASE IGNORE THE ATTACHED FILE HERE!

marcgeldon

2005-09-22 05:23

reporter   ~0007956

This bug does still exist. I will create a demo application for you and merge my changes into the actual source code from today.

marcgeldon

2005-09-22 05:25

reporter   ~0007957

Please forget the source code I've posted in the "additional information". There is another bug to fix. I'll upload the new JvDBTreeView with demo application.

marcgeldon

2005-09-22 05:51

reporter   ~0007959

ATTENTION! This bug is no longer actual. Check out bug no. 0003214 with different bugs I found on the component "JvDBTreeView".

obones

2005-11-22 09:18

administrator   ~0008138

See 0003214

Issue History

Date Modified Username Field Change
2005-03-08 06:13 marcgeldon New Issue
2005-03-08 06:13 marcgeldon File Added: JvDBTreeView.pas
2005-03-08 12:27 marcgeldon Note Added: 0006656
2005-03-10 00:38 marcgeldon Note Added: 0006667
2005-03-10 00:42 marcgeldon Note Added: 0006668
2005-05-18 09:42 obones Relationship added related to 0002733
2005-09-22 05:23 marcgeldon Note Added: 0007956
2005-09-22 05:25 marcgeldon Note Added: 0007957
2005-09-22 05:51 marcgeldon Note Added: 0007959
2005-11-22 09:18 obones Relationship added parent of 0003214
2005-11-22 09:18 obones Status new => closed
2005-11-22 09:18 obones Note Added: 0008138