Re: deleting nodes in tree2

2005-10-13 Thread Alban Coulange
Well,
I tried both of your solutions, I thought it was working,
but after a while it has re-appeared!!!
I don't know what to do.
Maybe I will change the look of my web page.
If I delete a node it turns " " (it is an example) into
"<p>&nbsp</p>"!! And it is not because I am using &nsbp I tried
with the BR and other stuff.
I am really closed to give up!
Alban.






Re: deleting nodes in tree2

2005-10-06 Thread alban
Thanks for your reply.
How I delete nodes? I have checkboxes at each leaf and each level of my tree. 
If the user submits the form with a button say "Submit" it calls an 
actionListener, gets the tree2 check all the checkboxes and deletes the nodes. 
This step works fine. After that, it looks like the tree gets lost with the 
ids.
It seems to be a bug http://issues.apache.org/jira/browse/MYFACES-351 !!!
So I don't know what to do...
Alban.




deleting nodes in tree2

2005-10-05 Thread Alban Coulange
Hello,
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()
.findComponent(":validationForm:validation-tree");
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
***
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sda]] 
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 
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.
Thanks,
Alban.




myfaces tree2

2005-10-03 Thread Alban Coulange
Hello,
I have got a strange error using myfaces 1.0.9 with the tree2 component.
Eclipse 3.1, tomcat 5.5.9



2005-09-23 16:43:40,359 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sda]] 
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

at org.apache.myfaces.custom.tree2.TreeModel.getNodeById(TreeModel.java:153)
at org.apache.myfaces.custom.tree2.TreeModel.setNodeId(TreeModel.java:71)
at org.apache.myfaces.custom.tree2.UITreeData.setNodeId(UITreeData.java:290)
at org.apache.myfaces.custom.tree2.HtmlTree.setNodeId(HtmlTree.java:80)
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.decode
(HtmlTreeRenderer.java:113)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:305)
at org.apache.myfaces.custom.tree2.UITreeData.processDecodes
(UITreeData.java:139)
at org.apache.myfaces.custom.tree2.HtmlTree.processDecodes(HtmlTree.java:91)
at javax.faces.component.UIComponentBase.processDecodes
(UIComponentBase.java:407)
at javax.faces.component.UIComponentBase.processDecodes
(UIComponentBase.java:407)
at javax.faces.component.UIComponentBase.processDecodes
(UIComponentBase.java:407)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:151)
at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues
(LifecycleImpl.java:177)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:87)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter
(ExtensionsFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.
processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)

***

The problem is that you can' t predict when this exception is raised. I have
read some posts about this problem, but I can't find a suitable solution to my
problem (because sometimes I am not making deletion of nodes, I am just clicking
on a link that has nothing to do with the tree2 component and the exception is
still raised). Is there a proper way to use that component? Is this a bug?
Should I use myfaces 1.1.0 instead? (I am planning to).
Well, any help would be appreciated.
Thanks