View Issue Details

IDProjectCategoryView StatusLast Update
0003369JEDI VCL00 JVCL Componentspublic2006-01-03 04:01
ReporterWBennerAssigned Toelahn 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.20 
Summary0003369: Move for tjvSimpleXML
DescriptionI'm missing the feature to move an tjvSimpleXMLElem item in JVSimpleXML. There are only procedures to add and delete an item.
TagsNo tags attached.

Activities

elahn

2005-12-18 01:45

developer   ~0008221

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.

WBenner

2005-12-20 09:27

reporter   ~0008230

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.

elahn

2005-12-20 20:05

developer   ~0008231

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

I've added Move and IndexOf to TJvSimpleXMLElems. This is now in CVS.

WBenner

2005-12-22 02:32

reporter   ~0008232

I cannot compile jvSimpleXML.pas: Undeclared identifier "ReadCharsFromStream" :-(

elahn

2005-12-22 03:09

developer   ~0008233

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

http://jvcl.sf.net/daily

If it occurs then, create a new issue.

WBenner

2005-12-26 03:08

reporter   ~0008237

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!

elahn

2005-12-26 22:29

developer   ~0008242

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.

WBenner

2005-12-27 07:19

reporter   ~0008244

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?

WBenner

2005-12-29 05:25

reporter   ~0008251

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!

elahn

2005-12-29 05:49

developer   ~0008252

I think you forgot to upload the zip file. :)

2005-12-30 01:31

 

XMLTest.zip (3,879 bytes)

WBenner

2005-12-30 01:32

reporter   ~0008255

Sorry,

i have forgot to click on Upload Button :-)

elahn

2006-01-01 08:22

developer   ~0008260

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

WBenner

2006-01-03 03:43

reporter   ~0008265

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