myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acoulange_alteca <>
Subject [jira] Commented: (MYFACES-351) [tree2] Cannot dynamically add or delete nodes
Date Wed, 05 Oct 2005 09:43:30 GMT
I would like to know if I was deleting nodes correctly in the tree.
I get the tree : 

FacesContext facesContext = FacesContext.getCurrentInstance();
		ht = (HtmlTree) facesContext.getViewRoot()
		root = (ValidationTreeNode)ht.getValue();

I get the list of children, 
Iterator it = root.getChildren().iterator();
and remove the one I don't need any more via an iterator over that list. 
And then : 
ht.setValue(root); or //ht.setValue(root);

But doing this, I got strange problems : 
I get the exception
Node with id 0:0. Failed to parse 0:0:0
java.lang.IllegalArgumentException: Node with id 0:0. Failed to parse 0:0:0
 or not (it is  not predictible).
Or it looses (I think) the ids and it affects the rest of the page (some
<br> are turned into &alt br &alt if I don't put MY ids)
If I put my ids in the rest of the components, then the ergonomics is not
affected. The last example every time I remove a node.
For the exception above it occurs whenever it wants!

Is there a proper way to use the tree2?
Any help would be very appreciated.

View raw message