This content has been marked as final.
Show 5 replies
-
1. Re: Is it possible to put different colors in different nodes of a rich:tree?
edilmar Jan 10, 2014 3:38 PM (in response to edilmar)I didn't find a way to call a event method in style or styleClass property that knows what is the actual node, and I do the logical business to return #00FF00 (red) or normal color.
-
2. Re: Is it possible to put different colors in different nodes of a rich:tree?
liuliu Jan 13, 2014 3:10 AM (in response to edilmar)hi,
You cant creat your node with this color?
-
3. Re: Re: Is it possible to put different colors in different nodes of a rich:tree?
edilmar Jan 13, 2014 11:31 AM (in response to liuliu)This is my rich:tree, using treeModelRecursiveAdaptor but how to know what is the actual node in the outputText below, to set up the style?
<rich:tree id="campos" var="item" toggleType="client" selectionType="ajax"> <rich:treeSelectionChangeListener listener="#{emissaoCCe.selectionChanged}"/> <rich:treeModelRecursiveAdaptor roots="#{emissaoCCe.raizArqXMLAss}" nodes="#{item.grupos}"> <rich:treeNode expanded="true" iconExpanded="/imagens/abrirpasta.png" iconCollapsed="/imagens/fecharpasta.png" iconLeaf="/imagens/inserir.gif"> <h:outputText value="#{item.tituloGrupo}"/> </rich:treeNode> </rich:treeModelRecursiveAdaptor> </rich:tree> -
4. Re: Re: Is it possible to put different colors in different nodes of a rich:tree?
edilmar Jan 13, 2014 11:56 AM (in response to edilmar)Now I got to do this with nodeType property, and duplicating the rich:treeNode.
This is not the better solution, because it is needed to duplicate this code, but it works.
-
5. Re: Re: Re: Is it possible to put different colors in different nodes of a rich:tree?
michpetrov Jan 14, 2014 9:34 AM (in response to edilmar)The #{item} variable holds the node so you can call a method on that.
<h:outputText value="#{item.tituloGrupo}" style="color: #{bean.chooseColor(item)"/>
On the other hand, if you're checking all the nodes you might just add a color variable and set it during the check.