-
1. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
nbelaevski Dec 16, 2010 5:51 AM (in response to apashkev)Hi Andriy,
Just to clarify: you have only a single copy of each RF .jar (api, impl, ui) in a packaged application and EAR contains api, while WAR/WEB-INF/lib contain impl & ui, correct?
-
2. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
apashkev Dec 16, 2010 6:35 AM (in response to nbelaevski)Hi Nick! Thanks for quick reply!
Actually my application logic is contained in separate jar, which is included to EAR, so to be able to use TreeNodeImpl and org.richfaces.component.html.HtmlTree in code of the jar I need to add *impl.jar and *ui.jar to my EAR, am I correct?
So my project structure differs from one you described... is it forced to be so ?
-
3. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
nbelaevski Dec 16, 2010 7:18 AM (in response to apashkev)Component classes are not expected to be used by EJB beans, so it's not correct to place impl/ui there. If you need to operate with component classes, you can use managed beans or Seam components located in EAR. The most frequent reason for CCEs is presence of different copies of the same class coming from different class loaders; they are not equal, and so it fails with CCE.
-
4. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
apashkev Dec 16, 2010 10:24 AM (in response to nbelaevski)I've done some refactoring, so now I have ui and impl in my war and api in EAR. It works fine.
I've got one more question. Is it possible to load each tree node children with ajax requests?
I've noticed that there is "switchType=ajax" but it just reloads all the tree every time a node is expanded. What I'm trying to achieve is to handle each expansion event on server side and add data to expanded node. The reason for such an approach is that I'm retrieving data for tree over SOAP which is slow.
Thanks in advance.
-
5. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
nbelaevski Dec 16, 2010 10:34 AM (in response to apashkev)Andriy,
ajax mode should working exactly as you are asking - only toggled part of node should be updated. Are you re-rendering tree explicitly or implicitly (placed it into outputPanel with ajaxRendered=true)?
-
6. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
apashkev Dec 16, 2010 10:58 AM (in response to nbelaevski)Nick, you're right about tree wrapped in panel...
would you please provide me some details of switchType=ajax.
Do I need to create some specific listeners and add data to tree nodes in them or it will call getChildren() for expanded node? I'm just trying to understand , how those ajax requests are working.
Thanks again
-
7. Re: org.richfaces.model.TreeNodeImpl cannot be cast to javax.swing.tree.TreeNode
nbelaevski Dec 16, 2010 11:52 AM (in response to apashkev)Yes, it will call getChildren() for the expanded node.