You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Christopher J. Bowerman" <bo...@dtpax2.ncifcrf.gov> on 2006/05/24 15:16:20 UTC

Formatting Tree text?

Hi,

 

I am using the MyFaces tree2 component for application where the tree node
descriptions are a series of three numbers.  I'd like to color code the
numbers to match with other parts of the application.  I've tried to include
various html tags that I thought might do it, but it didn't seem to work.
In fact it just included the html tags in the description.  Is there any way
to do this?

 

I'm also like to preserve some whitespace, but it appears that the tree also
trims whitespace.  Again, anyway to do this?

 

Thanks,

 

Chris.

 

==================================

Christopher J. Bowerman

Internet Applications Developer

SAIC-Frederick

phone: 301.846.5275

email: christopher.j.bowerman@saic.com

 

 

 


Re: Formatting Tree text?

Posted by Andrew Robinson <an...@gmail.com>.
Tree2 just renders what you tell it. You can put HTML in your node
description if you want using escape = false on a output text (just
watch for security problems with this).

<f:facet name="node">
<t:outputText value="#{node.description}" escape="false" />
</f:facet>

Unless you have escape = false, you will see the HTML escaped (&gt;
for > for example). You can also put a bound component in the node if
you want (Build a UIComponent in your node and then bind a tag to that
in the view). That way you would have full programatic control of the
HTML output for your node.

-Andrew

On 5/24/06, Christopher J. Bowerman <bo...@dtpax2.ncifcrf.gov> wrote:
>
>
>
>
> Hi,
>
>
>
> I am using the MyFaces tree2 component for application where the tree node
> descriptions are a series of three numbers.  I'd like to color code the
> numbers to match with other parts of the application.  I've tried to include
> various html tags that I thought might do it, but it didn't seem to work.
> In fact it just included the html tags in the description.  Is there any way
> to do this?
>
>
>
> I'm also like to preserve some whitespace, but it appears that the tree also
> trims whitespace.  Again, anyway to do this?
>
>
>
> Thanks,
>
>
>
> Chris.
>
>
>
> ==================================
>
> Christopher J. Bowerman
>
> Internet Applications Developer
>
> SAIC-Frederick
>
> phone: 301.846.5275
>
> email: christopher.j.bowerman@saic.com
>
>
>
>
>
>