Hi ,
i tried to run this code:

<t:buffer into="#{myBuffer}">
    <h:outputText value="#{something}"/>
    <h:outputText value="#{somethingWithUnderline}"
                      style="text-decoration:underline"/>
    <h:outputText value="#{somethingelse}"/>
</t:buffer>

<h:selectOneRadio ... >
    <f:selectItem itemValue="1" itemLabel="#{myBuffer}" escape="false">
</h:selectOneRadio>

but my buffercontent is escaped by the selectOnRadio renderer. I take a look inside the selectItem component and i see there is a member named escape. But the HtmlRadioRendererBase.renderGroupOrItemRadio() method does not fetch the escape value of the selectItem and the HtmlRenderUtils.renderLabel method has not a parameter for the escape attribute.

Same problem is by using the <t:selectOneRadio ... > component.

To fix the problem i've done this:

HtmlRadioRendererBase.renderGroupOrItemRadio() Line ~199 :

// label element after the input
boolean componentDisabled = isDisabled(facesContext, selectOne);
boolean disabled = (componentDisabled || itemDisabled);
boolean escape = selectItem.isEscape();

HtmlRendererUtils.renderLabel(writer, selectOne, itemId,
                                selectItem.getLabel(), disabled,escape);

HtmlRendererUtils.renderLabel() Line ~1352:

public static void renderLabel(ResponseWriter writer, UIComponent       
        component, String forClientId,String labelValue, boolean        
                                disabled) throws IOException {
renderLabel(writer, component, forClientId, labelValue, disabled, true);
}


/**
 * Renders a label HTML element
 */
public static void renderLabel(ResponseWriter writer, UIComponent
component, String forClientId,String labelValue, boolean disabled, boolean escape) throws IOException {

...

if ((labelValue != null) && (labelValue.length() > 0)) {
        writer.write(HTML.NBSP_ENTITY);
        if (escape) {
                writer.writeText(labelValue, null);
        } else {
                writer.write(labelValue);
        }
}
...

maybe it helps someone.

bb, Jörg





Reply via email to