-
1. Re: how to customize tree icon in richfaces tree
ajaykadiyala May 24, 2010 5:52 AM (in response to jyothiainelly)Hi,
For customization of icon i am suggeting an idea.
<rich:treenode icon="{bean.iconPath}" .......... id="treenode"
<a4j:support event="onclick or check for patricular event which is assoicated with treenode collape and expand" action="#{bean.action}" render= "treenode"/>
</rich:treenode>
-------bean.java-------
public bean
{
action()
{
iconPath="/my/icon/dynamic.jpg" ;
}
}
-
2. Re: how to customize tree icon in richfaces tree
ilya_shaikovsky May 24, 2010 6:12 AM (in response to ajaykadiyala)moving thread to RichFaces space.
-
3. Re: how to customize tree icon in richfaces tree
kaimattern Dec 8, 2010 10:48 AM (in response to ajaykadiyala)I got the very same problem. I have a rich:tree and its populated with nodes. All nodes have a getIcon method which is bound to the treenode
<rich:tree style="width:300px"
nodeSelectListener="#{mssMain.processSelection}".
.
.
<rich:treeNode type="#{item.type}"
iconLeaf="#{item.icon}"
icon="#{item.icon}" id="treeNode">
<h:outputText value="#{item.stext}"/>
<a:support event="onclick" action="#{mssMain.update}" render="treeNode"/>
</rich:treeNode>as you can see I already tried the method mentioned above.
Everything is working fine, on nodeSelectListener is changing the icon from the node but its not updated. Once I close the parent of the selected node and reopen it, the icon is displayed correctly.
Anybody know how to change the icon of the tree node on the fly?
best regards,
Kai
-
4. Re: how to customize tree icon in richfaces tree
nbelaevski Dec 8, 2010 6:47 PM (in response to kaimattern)Kai,
You should set ajaxKeys attribute to a set of row keys that should be updated.
-
5. Re: how to customize tree icon in richfaces tree
kaimattern Dec 9, 2010 2:39 AM (in response to nbelaevski)Hello Nick,
thanks for your replay. I'll test that. I figured out another way yesterday evening.
<rich:tree style="width:300px"
nodeSelectListener="#{mssMain.processSelection}"
reRender="mssTree,selectedNode" ajaxSubmitSelection="true"
switchType="ajax" value="#{mssMain.treeNode}" var="item"
nodeFace="#{item.type}"
ajaxKeys="#{null}"
id="mssTree">First I thought that might be a hard approach and only tried it out of desperation but its working real nice even with more then hundred nodes and a full exanded tree.
But I'll definatly try yours, it looks more feasible.
Best regards,
Kai
-
6. Re: how to customize tree icon in richfaces tree
nbelaevski Dec 9, 2010 5:41 AM (in response to kaimattern)BTW, forgot to say that you can use ajaxNodeKeys (the same set of keys) to update only node without subtree.