-
1. Re: Refresh rich:treeNode
nbelaevski Dec 21, 2010 5:04 PM (in response to apashkev)Hi Andriy,
Yes, it's possible. Use ajaxKeys attribute for that.
-
2. Re: Refresh rich:treeNode
apashkev Dec 22, 2010 5:50 AM (in response to nbelaevski)Hi, Nick!
Thanks for the answer. Would you please provide me some example of doing the above thing. I can't find any samples with ajaxKeys set to something that is not null.
Regards
-
3. Re: Refresh rich:treeNode
nbelaevski Dec 22, 2010 8:36 AM (in response to apashkev)Andriy,
Please take a look: http://community.jboss.org/message/53393 and http://eclipse.dzone.com/articles/an-introduction-to-jboss-richf?page=2,5
-
4. Refresh rich:treeNode
apashkev Jan 26, 2011 12:21 PM (in response to nbelaevski)Hi Nick! I'm still facing some troubles with refreshing tree nodes, for now I've came up with a temporary solution, which however doesn't suite performance requirements.
I was trying to implement this feature using your advice and I've got a problem, with the following line :
HtmlTree tree = (HtmlTree) e.getComponent();
it throws
org.richfaces.component.html.HtmlTree cannot be cast to org.richfaces.component.html.HtmlTree
As the links you've provided are not showing the full code, I'd like to download a working demo with such an approach implemented. Is this possible?
Thanks in advance!
-
5. Refresh rich:treeNode
nbelaevski Jan 26, 2011 12:27 PM (in response to apashkev)Hi Andriy,
Most likely you are having two different instances of HtmlTree class in class path (e.g. one as EJB module dependnecy, another deployed in WAR/WEB-INF/lib). Is it so?
-
6. Refresh rich:treeNode
apashkev Jan 26, 2011 1:14 PM (in response to nbelaevski)Hi Nick! Thanks for a quick response. Yes! To be able to use HtmlTree in code behind I was forced to move it's dependencies to other project modules and they are contained in WAR as well. It is done because the project's WAR doesn't contain java code at all.
Is there a way to add those dependencies to EAR and use them in WAR? Dependecies are managed with Maven 2.
Best regardsAndriy
-
7. Refresh rich:treeNode
nbelaevski Jan 26, 2011 1:45 PM (in response to apashkev)Andriy,
It is highly not recommended to operate over JSF components from EJB code, but possible to use generic UIComponent API like this:
UIComponent t = e.getComponent();
Object rowKey = t.getAttributes().get("rowKey");
//do the needful
JSF API is part of JEE5 server, so should be accessible from EJB beans.
-
8. Re: Refresh rich:treeNode
apashkev Jan 27, 2011 3:54 AM (in response to nbelaevski)Nick,
JSF API is accessible, but what I was trying to achieve looks like the following
processSelection(NodeSelectedEvent e) {
HtmlTree tree = (HtmlTree)e.getComponent();
TreeRowKey parentKey = tree.getParentRowKey(tree.getRowKey());
...
}
is it possible to get parentRowKey from UIComponent ?
one more thing... is there a way to call processSelection on right mouse button click?
Thanks
-
9. Refresh rich:treeNode
apashkev Jan 28, 2011 12:58 PM (in response to nbelaevski)Nick!
I've spent few hours working with tree component... and I'm wondering why changeExpandListener is never called ? ... I've also tried to add the following
<a4j:support event="onexpand"
action="#{action.expandNode(_node)}" />
however expandNode still doesn't gets called ...
any ideas?...
Regards
Andriy