-
1. Re: rich:Tree remains empty
nbelaevski Mar 26, 2007 10:38 AM (in response to tomba)Hello!
Tree component handles children of the root node, not the node itself in order to have several top-level nodes. Maybe that's the case?
You can use TreeNodeImpl as that fake root node. Just create the new one and add yours under any key. -
2. Re: rich:Tree remains empty
tomba Mar 26, 2007 11:26 AM (in response to tomba)Thank you,
could be something like it as just creating 2 TreeNodeImpl and making them parent and child renders me one node.
However, I can't seem to wrap my DirectoryTree in such a TreeNodeImpl as I get a class cast exception:
javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Error getting property 'directories' from bean of type be.sofico.extranet.dynamic.files.PublicDownload: java.lang.ClassCastException: org.richfaces.component.TreeNodeImpl
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:190)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)
at javax.faces.component.UIData.getValue(UIData.java:547)
at org.richfaces.component.UITree.createDataModel(UITree.java:477)
at org.ajax4jsf.ajax.repeat.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:464)
at org.ajax4jsf.ajax.repeat.UIDataAdaptor.setRowKey(UIDataAdaptor.java:280)
at org.ajax4jsf.ajax.repeat.UIDataAdaptor.setRowKey(UIDataAdaptor.java:265)
It happens with:
TreeNodeImpl tn = new TreeNodeImpl();
tn.addChild("sqdfqqsddgrfgtggzqshyhyaez", dirs);
It's probably the object identifier which is the problem, I chose a random string since I'm not sure what to put there ;)
Any ideas?