-
1. Re: Problem with recursiveTreeNodesAdaptor
nbelaevski Apr 19, 2009 3:06 PM (in response to mabaumga)Hi Marc,
Probably, there are no child files/folders or bean is unable to read them. Can you please check that? -
2. Re: Problem with recursiveTreeNodesAdaptor
mabaumga Apr 19, 2009 4:03 PM (in response to mabaumga)Hi Nick,
thank you for your answer. No, there are a lot of childs / folders. Even if I hard code the return of some childs they are not shown. It seems that my function getNodes() is only called in the first layer.
If have the following structure:
Root:
/
First Layer:
/WEB-INF
/META-INF:
Second Layer:
/WEB-INF/lib
/WEB-INF/classes
/WEB-INF/web.xml
....
Third Layer:
/WEB-INF/lib/log4j.jar
.....
If I debug, the function "getNodes()" is called in the Root and in the WEB-INF node but not deeper.
Maybe there is something wrong with my environment? I am working with a Tomcat 6.
Regards,
Marc -
3. Re: Problem with recursiveTreeNodesAdaptor
ilya_shaikovsky Apr 24, 2009 12:33 AM (in response to mabaumga)show your bean code.
-
4. Re: Problem with recursiveTreeNodesAdaptor
mabaumga Apr 26, 2009 10:40 AM (in response to mabaumga)There is a strange behavior: On my notebook machine it doesn't work and on my desktop machine it works. It is the same code. I want have a dynamic loading of the child nodes. Maybe there is a problem in the hibernate part because the difference between both machines are the databases: mysql on notebook and oracle on desktop. But anyway here is the relevant code:
JSF:<rich:tree id="menue" style="width:200px;max-width:400px;" ajaxSubmitSelection="true" switchType="ajax" nodeSelectListener="#{PageManager.selectNode}" reRender="pagePanel,pageLinkPanel" acceptedTypes="page" dropListener="#{PageManager.processDrop}"> <rich:recursiveTreeNodesAdaptor roots="#{PageManager.root}" var="item" nodes="#{item.childList}"> <rich:treeNode dragType="page" dragValue="#{item}" dragIndicator="indicator"> <rich:dndParam name="label" value="#{item.pagetitle}" /> <h:outputText value="#{item.pagetitle}" /> </rich:treeNode> </rich:recursiveTreeNodesAdaptor> </rich:tree>
PageManager:public PageManager(){ private WebPage root; .... public WebPage getRoot() { if (root == null) { root = ControllerDictionary.get().getPageDao().findById( new Long(1), false); } return root; } }
WebPage:public class WebPage{ @Transient private List<WebPage> childList = null; @Transient private Calendar childReadDate = null; ... public List<WebPage> getChildList() { if (childList == null) { logger.debug("Load for Page " + this.getId()); childList = ControllerDictionary.get().getPageDao().getChildList( this); childReadDate = Calendar.getInstance(); for (WebPage p : childList) { p.setParentNode(this); } } else { logger.debug("Childnodes for Page " + this.getId() + " already loaded"); } return childList; } }
If I open the root node I can see in my log that the function getChildList is called very often, but at the object of the root node!
So I have a lot of log entries like this:Childnodes for Page 1 already loaded
But I would expect some thing like:Load for Page 2 Load for Page 3 Load for Page 4 Load for Page 5 ...
Any hint? -
5. Re: Problem with recursiveTreeNodesAdaptor
nbelaevski Apr 26, 2009 11:30 AM (in response to mabaumga)Hello,
Commons-collections of 2.x version can cause the issue. Can you please check which version you are using? -
6. Re: Problem with recursiveTreeNodesAdaptor
mabaumga Apr 27, 2009 10:20 AM (in response to mabaumga)Nick, you are right. I got the common-collection 2.1.1 in the classpath. Now with 3.2 everything is fine.
Thank you very much and regards from Germany
Marc