I have a PrimeFaces p:tree
and I was able to add font awesome expanded and collapsed icons using this, but there is an arrow icon before that which is from PrimeFaces and I was not able to figure out how to switch it font awesome arrows (fa-arrow-circle-down
and fa-arrow-circle-right
), or changing the color to white also suffices my need.
I have looked at the Firebug and found that the PrimeFaces arrow is from an image url("/permitweb-1.0/faces/javax.faces.resource/images/ui-icons_616161_256x240.png?ln=primefaces-aristo")
I am not sure I can change the color of the image without creating or importing a new image.
I looked at other posts here because PrimeFaces was using an image and FontAwesome is CSS, I am not sure how to replace the arrow, TreeNode
doesn't have a setIcon
method like MenuItem
.
Here is my tree code:
<p:tree selectionMode="single">
<p:treeNode expandedIcon="fa fa-folder-open" collapsedIcon="fa fa-folder">
<h:outputText value="Home" />
</p:treeNode>
<p:treeNode type="document" icon="fa fa-file-text-o fileColor">
<h:outputText value="Staff" />
</p:treeNode>
</p:tree>
Tree arrow icon: