View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002868 | JEDI VCL | 00 JVCL Components | public | 2005-04-13 08:50 | 2006-01-26 00:52 |
Reporter | brethren70 | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.20 | |||
Summary | 0002868: JvDBTreeview with JvDock...Component raise exception "expression expected but nothing found" | ||||
Description | 1. form1 with JvDockserver 2. form2 with JvDockClient , JvDBTreeview with ClientDataSet 3. show form2. 4. It will be fine. it's normal. 3. dock form2 to form1. 4. it will show exception "expression expected but nothing found". sorry for my poor English. :( | ||||
Tags | No tags attached. | ||||
|
Could you post a sample application, I have a hard time reproducing this. |
|
I can't upload a sample file. browser show "server not found" HTTP error. So, I upload sample program in my server. http://brethren70.cafe24.com/dev/bugreport/JvDBTreeview_BugReport.zip I hope someone could upload the file to this issue tracker. Thanks in advance. |
|
Could you please add the MenuTreeUnit pas/dfm-Fils to the zip...? |
|
Sorry for my mistake. I add the missing files to archive. :) |
2005-04-17 22:25
|
JvDBTreeview_BugReport.zip (12,435 bytes) |
|
Ok, here is a not so clean solution, but that's the best I can come up with, considering that TTreeNode.WriteData and TTreeNode.ReadData are private. Anyway, add this in the protected section of the TJvCustoMDBTreeView interface: FSavedActive : Boolean; procedure CreateWnd; override; procedure DestroyWnd; override; Then in the implementation section, add this: procedure TJvCustomDBTreeView.CreateWnd; begin inherited CreateWnd; if Assigned(FDataLink) and Assigned(FDataLink.DataSet) then FDataLink.DataSet.Active := FSavedActive; end; procedure TJvCustomDBTreeView.DestroyWnd; begin if Assigned(FDataLink) and Assigned(FDataLink.DataSet) then begin FSavedActive := FDataLink.DataSet.Active; FDataLink.DataSet.Active := False; end; inherited DestroyWnd; end; Basically, the docking/undocking of the window means that it is destroyed and recreated. In order for the nodes to be valid, me make the dataset inactive. This might be a pain if it takes ages to make a dataset active. That's why I'm NOT happy with that solution and am still trying to find a better way to do this. Please let me know how this goes |
|
Thanks, obones. It works. Exception is gone. But, I hope TJvDBTreeview can restore the state of treeview after docking. Please, let me know if you can do it. :) |
|
Well, that's the problem, because it gets recreated, it won't save it's current status. But I'll have a shot at it later on. |
|
TTreeNode.WriteData and TTreeNode.ReadData doesnt handle TJvDBTreeNode.FMasterValue. May be solution is to reproduce this private methods in JvDBTreeView module (with FMasterValue handling) and then override CreateWnd and DestroyWnd methods (in fact, reproduce them too) |
|
I know, but the WriteData and ReadData are private, and so are the methods calling them. Thus it is very hard to override these and get them called. |
|
Not so hard, because they called only from virtual methods: CreateWnd, DestroyWnd and Assign. TTreeNodes.DefineProperties use ReadData and WriteData, but it can use "inherited" methods. So, may be enought to rewrite this list of methods: TJvDBTreeNode.WriteDataNew - reproduce with FMasterValue handling; TJvDBTreeNode.ReadDataNew - reproduce with FMasterValue handling; TJvDBTreeView.CreateWnd - override; TJvDBTreeView.DestroyWnd - override; TJvDBTreeView.Assign - override; |
|
Ok, may be it is really hard. This is my solution (without closing and opening dataset): protected ... procedure CreateWnd; override; // ivan_ra ... procedure TJvCustomDBTreeView.CreateWnd; begin inherited CreateWnd; if not ValidDataSet or UpdateLocked then Exit; RefreshChild(nil); // UpdateTree; // and now select current record: SelectNode(FDataLink.DataSet.FieldByName(MasterField).AsVariant); end; function TJvCustomDBTreeView.CreateNode: TTreeNode; begin Result := TJvDBTreeNode.Create(Items); TJvDBTreeNode(Result).FMasterValue:=null; // ivan_ra end; |
|
This is closed by 0003373 and related topics |
|
As indicated by ivan_ra, fixed by 0003373 |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-04-13 08:50 | brethren70 | New Issue | |
2005-04-14 06:48 | obones | Note Added: 0007003 | |
2005-04-14 06:48 | obones | Status | new => feedback |
2005-04-14 23:41 | brethren70 | Note Added: 0007010 | |
2005-04-14 23:52 | brethren70 | Note Edited: 0007010 | |
2005-04-15 03:37 | DRothmaler | Note Added: 0007011 | |
2005-04-15 03:37 | DRothmaler | Note Edited: 0007011 | |
2005-04-15 06:08 | brethren70 | Note Added: 0007012 | |
2005-04-17 22:25 | anonymous | File Added: JvDBTreeview_BugReport.zip | |
2005-04-18 07:05 | obones | Note Added: 0007023 | |
2005-04-19 06:54 | brethren70 | Note Added: 0007028 | |
2005-04-22 05:41 | obones | Note Added: 0007040 | |
2005-04-26 07:36 | ivan_ra | Note Added: 0007068 | |
2005-04-26 07:41 | obones | Note Added: 0007069 | |
2005-04-26 07:57 | ivan_ra | Note Added: 0007071 | |
2005-04-26 08:33 | ivan_ra | Note Added: 0007072 | |
2005-04-26 23:58 | ivan_ra | Note Edited: 0007072 | |
2005-04-27 06:54 | ivan_ra | Note Edited: 0007072 | |
2006-01-25 13:00 | ivan_ra | Note Added: 0008455 | |
2006-01-26 00:52 | obones | Status | feedback => resolved |
2006-01-26 00:52 | obones | Resolution | open => fixed |
2006-01-26 00:52 | obones | Assigned To | => obones |
2006-01-26 00:52 | obones | Note Added: 0008458 |