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
0003369 [JEDI VCL] 00 JVCL Components feature always 2005-12-16 05:38 2006-01-03 04:01
Reporter WBenner View Status public  
Assigned To elahn
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003369: Move for tjvSimpleXML
Description I'm missing the feature to move an tjvSimpleXMLElem item in JVSimpleXML. There are only procedures to add and delete an item.
Additional Information
Tags No tags attached.
Attached Files zip file icon XMLTest.zip [^] (3,879 bytes) 2005-12-30 01:31

- Relationships

-  Notes
(0008221)
elahn (developer)
2005-12-18 01:45

If a Value of type TJvSimpleXMLElem is an element of MyElemA.Items, then you call:

MyElemB.Items.Add(Value)

...then Value is removed from MyElemA.Items and added to MyElemB.Items

So, to move an item, simply add it to where you want it to go.
(0008230)
WBenner (reporter)
2005-12-20 09:27

But there is no solution for insert an item to another place within MyElemA.Items. Add moves the node to the last place. I need this feature to reorganize a XML-Tree like a tree with drag and drop notes from one to another place.
(0008231)
elahn (developer)
2005-12-20 20:05

Ok, now I understand what you're asking for. :)

I've added Move and IndexOf to TJvSimpleXMLElems. This is now in CVS.
(0008232)
WBenner (reporter)
2005-12-22 02:32

I cannot compile jvSimpleXML.pas: Undeclared identifier "ReadCharsFromStream" :-(
(0008233)
elahn (developer)
2005-12-22 03:09

This must be an unrelated issue. Use the daily build:

http://jvcl.sf.net/daily [^]

If it occurs then, create a new issue.
(0008237)
WBenner (reporter)
2005-12-26 03:08

Many thanks for the two features Move and Indexof, but i have trouble with MyElemB.Items.Add(Value). If Value is a member of MyElemA.Items, then it is added to MyElemB.Items but not removed from MyElemA.Items! Look for my code:

    idx1:=xml1.Parent.GetChildIndex(xml1);
    idx2:=xml2.Parent.GetChildIndex(xml2);
    If xml1.Parent = xml2.Parent then // is ok
      xml1.Parent.Items.Move(Idx1,Idx2)
    else // different Parent
    begin
      xml1.Parent.Items.Add(xml2); // moves to end of list
      xml1.Parent.Items.Move(xml2.Parent.Items.IndexOf(xml2),idx1);
    end;

After this code, xml2 is a member of xml1.Parent.Items and old xml2.Parent.Items!
(0008242)
elahn (developer)
2005-12-26 22:29

It's working correctly in my test program... Please create a demo program that produces the bug and attach it to this issue. Please zip up only the .dpr, .dfm & .pas files.
(0008244)
WBenner (reporter)
2005-12-27 07:19

It's difficult for me to extract the code from my project. I will send you an test project in the next days (or next year :-)

Can you still add a routine "MyElems.Insert(fromItem,ToItem)" where fromItem is a member of a different parent and ToItem is a member of MyElems?
(0008251)
WBenner (reporter)
2005-12-29 05:25

I have made a exmaple program to demonstrate the bug. Compile the program and start it. You see in the bottom of screen the elements of <elem>.parent.
ADR_Anspar has 17 elems and Wiedervorlagen has 3 elems.

Drag the node Geburtstag in ADR_Anspar/Wiedervorlagen and drop onto the node "Handy" (or another elem in this level). After this action ADR_Anspar has 18 elems but "Wiedervorlagen" shows 3 elemtents and not 2!
(0008252)
elahn (developer)
2005-12-29 05:49

I think you forgot to upload the zip file. :)
(0008255)
WBenner (reporter)
2005-12-30 01:32

Sorry,

i have forgot to click on Upload Button :-)
(0008260)
elahn (developer)
2006-01-01 08:22

The first bugfix in the CVS log message below, is the one that was causing your issue. This is now fixed in CVS. Please check that this works correctly for you and let me know.

Bugfixes:
- TJvSimpleXMLElem.Container was not being set when XML data is loaded (Mantis 0003369)
- TJvSimpleXMLElem.JvSimpleXML was not being set when XML data is loaded
- TJvSimpleXMLElem.Parent was not being set in AddChild or AddChildFirst
Additions:
- TJvSimpleXMLElems.Insert
(0008265)
WBenner (reporter)
2006-01-03 03:43

It works fine, good work!

- Issue History
Date Modified Username Field Change
2005-12-16 05:38 WBenner New Issue
2005-12-18 01:45 elahn Note Added: 0008221
2005-12-20 09:27 WBenner Note Added: 0008230
2005-12-20 20:05 elahn Status new => resolved
2005-12-20 20:05 elahn Resolution open => fixed
2005-12-20 20:05 elahn Assigned To => elahn
2005-12-20 20:05 elahn Note Added: 0008231
2005-12-22 02:32 WBenner Status resolved => feedback
2005-12-22 02:32 WBenner Resolution fixed => reopened
2005-12-22 02:32 WBenner Note Added: 0008232
2005-12-22 03:09 elahn Status feedback => resolved
2005-12-22 03:09 elahn Resolution reopened => fixed
2005-12-22 03:09 elahn Note Added: 0008233
2005-12-26 02:57 WBenner Issue Monitored: WBenner
2005-12-26 03:08 WBenner Status resolved => feedback
2005-12-26 03:08 WBenner Resolution fixed => reopened
2005-12-26 03:08 WBenner Note Added: 0008237
2005-12-26 22:29 elahn Note Added: 0008242
2005-12-27 07:19 WBenner Note Added: 0008244
2005-12-29 05:25 WBenner Note Added: 0008251
2005-12-29 05:49 elahn Note Added: 0008252
2005-12-30 01:31 WBenner File Added: XMLTest.zip
2005-12-30 01:32 WBenner Note Added: 0008255
2006-01-01 08:22 elahn Note Added: 0008260
2006-01-03 03:43 WBenner Note Added: 0008265
2006-01-03 04:01 elahn Status feedback => resolved
2006-01-03 04:01 elahn Resolution reopened => fixed


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