I have a situation where I *think* the solution is to write a custom
renderer. It has brought up some issues with renderers I wanted to
ask about as well. Here's my problem:
I need to display a combo box with "hierarchical" select items. IOW,
the list of items in the combo box needs to be displayed as a tree
like follows:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
etc....
I tried to do this with in the itemLabel property of the
SelectItem and the renderer deleted the 's. I stepped through
the code and found the following in
HtmlRendererUtils.renderSelectOptions():
if (component instanceof EscapeCapable) {
escape = ((EscapeCapable) component).isEscape();
}
else {
escape =
RendererUtils.getBooleanAttribute(component, JSFAttr.ESCAPE_ATTR,
true);
//default is to escape
}
If I import that source file into my codebase and comment out the
above snippet everything works beautifully. So I thought maybe I
should just write a custom SelectItem renderer and use that. But this
code is in a static method of a utility class. I don't want a custom
renderer, I just want a custom implementation of this particular
method. Is there a better way to customize this? Or is there a way
to override the utility class with my own implementation?
Thanks,
Greg