The parent node stuff is not really available in tree2. We could change that but my thinking was to try and keep the interface as simple as possible. Of course your implementation of TreeNode can maintain a reference to parent as Rob is suggesting.
sean On Apr 3, 2005 10:30 AM, Rob Decker <[EMAIL PROTECTED]> wrote: > I think keeping a reference to the parent node is usually how it's done. > > Rob > > ----- Original Message ----- > From: "Timo Schn�lzer" <[EMAIL PROTECTED]> > To: "MyFaces Discussion" <[email protected]> > Sent: Sunday, April 03, 2005 5:54 AM > Subject: RE: Tree2 delete Item > > Hi Rob, > > That is what i expect to do. BUT: > > How to code the getParentTreeNode ()??? > > I already have the selected one as a HtmlTree and TreeNode in a field within > the managed bean. > Now, i have to "walk" the the parent object in order to delete the child to > be deleted: > > treeNodeSelected.getParentNode().getChildren().remove(treeNodeSelected) > --> then i have to add a reference to a treeNodes Parent within the e.g. > constructor of a node, not nice! > > Thx for help > > Timo > > -----Original Message----- > From: Rob Decker [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 02, 2005 4:44 PM > To: MyFaces Discussion > Subject: Re: Tree2 delete Item > > You can write your own implementation of TreeNode and delete from that. The > identifier can be used for whatever you want, like putting the primary key > for a database object the TreeNode wraps around. > > Rob > ----- Original Message ----- > From: "Timo Schn�lzer" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Saturday, April 02, 2005 5:17 AM > Subject: Tree2 delete Item > > Hi all, > > Tree2 works and everything is fine with adding nodes and changing nodes (the > description). > But what is the way to simple delete a Node from the TreeNodeBase??? > > (hope this questions is not stupid as i tried this for hours now!!!) > > BTW: What is the use of the identifier in the TreeNodeBase??? > > Thx for help > > Timo > > Mit freundlichem Gruss > > NSD Communication Consulting GmbH > > Dipl.-Kfm. > Timo Schn�lzer > (Gesch�ftsf�hrer) > > _________________________________________________ > NSD Communication Consulting GmbH > Ludwig-Erhard Str. 8 * 45891 Gelsenkirchen Telefon +49.209.94041.40 * Fax > +49.209.94041.99 e-mail [EMAIL PROTECTED] > _________________________________________________ > > ____________ > Virus checked by G DATA AntiVirusKit > Version: AVK 14.0.38 from 02.11.2003 > Virus news: www.antiviruslab.com > > ____________ > Virus checked by G DATA AntiVirusKit > Version: AVK 14.0.38 from 02.11.2003 > Virus news: www.antiviruslab.com > >

