Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Changing parent of a node in the tree table
Changing parent of a node in the tree table [message #1110106] Mon, 16 September 2013 11:33 Go to next message
Ali Malik is currently offline Ali Malik
Messages: 27
Registered: August 2013
Junior Member
Hi,

I have populated my Tree Table, with some nodes.
Before adding these nodes to the table, I assign them their parent (if any), then add them to the Table.(event list actually).

For example:

Node node = new Node();
node.setParent(parentNode);

eventList.add(node);


Something like that!

Anyways, what I need to do is that when I change its parent to some other node, it should be a child of some other node and reflected in the Tree Table.
But it stays the child of the same node.

For example:

Before
-Parent1:
--Child1
--Child2


Child2 is child of Parent1.

After I make Child2 a child of Child1, the result stays the same:
-Parent1:
--Child1
--Child2


Instead of:
-Parent1:
--Child1
---Child2


Is this some restriction in the table, or am I doing something wrong?

Regards,
Ali Ahmad Malik
Re: Changing parent of a node in the tree table [message #1110213 is a reply to message #1110106] Mon, 16 September 2013 14:46 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1347
Registered: July 2012
Senior Member
Haven't worked on such cases. Are you sure the TreeList reflects your modifications correctly? And if so, do you perform a refresh after your modifications?
Re: Changing parent of a node in the tree table [message #1110821 is a reply to message #1110213] Tue, 17 September 2013 11:16 Go to previous messageGo to next message
Ali Malik is currently offline Ali Malik
Messages: 27
Registered: August 2013
Junior Member
I did refresh the NatTable after doing that, but no use.

I am not sure where does the problem lie, after changing the parent I also tried:

        sortedList = new SortedList<IDSTreeTableNode>(eventList, null);
        
        treeList = new TreeList<IDSTreeTableNode>(sortedList,
        		treeTableFormat, expansionModel);

        treeData = new DSTreeTableData(treeList);

        treeRowModel = new GlazedListTreeRowModel<IDSTreeTableNode>(treeData);


This should have changed the TreeList, too. I will try and debug for the TreeList now.

Any suggestions?
Re: Changing parent of a node in the tree table [message #1110850 is a reply to message #1110821] Tue, 17 September 2013 12:03 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1347
Registered: July 2012
Senior Member
Not quite sure, did you check your TreeList.Format and TreeList.ExpansionModel?
Previous Topic:checkbox problem
Next Topic:State saving is buggy...
Goto Forum:
  


Current Time: Thu Oct 30 15:52:22 GMT 2014

Powered by FUDForum. Page generated in 0.02169 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software