myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <lu4...@gmail.com>
Subject Re: f:selectItem escape attribute doesn't work ?
Date Sat, 01 Sep 2012 02:58:11 GMT
Hi

I checked the problem and it seems to be a typo error. Instead
"escape" use "escapeItem":

            <t:selectOneRadio id="idRadioJSF" layout="spread">
                <f:selectItem itemValue="1"
itemLabel="#{controller.formatLabel('test')}" escapeItem="false" />
            </t:selectOneRadio>
            <t:radio index="0" for="idRadioJSF" id="testRADIOJSF0" />

I tried it and it works. See
https://issues.apache.org/jira/browse/MYFACES-2457 for details.

regards,

Leonardo Uribe

2012/8/31 Mike Kienenberger <mkienenb@gmail.com>:
> Have you tried tracing what is happening through the debugger?
> My guess is that there's a bug in the t:selectOneRadio renderer.
> It seems like it would be straightforward to determine the cause and
> submit a patch.
> You might even be able to find the problem by examining the
> t:selectOneRadio encoding code.
>
> On Wed, Aug 8, 2012 at 6:49 AM, Patrick Meyer <patrick.meyer@o2.pl> wrote:
>> Hi,
>>
>> I would like to format selectItem label with html tags in  selectOneRadio component.
But the label is not rendered as HTML. What I'm doing wrong?
>>
>> &lt;t:selectOneRadio id="idRadioJSF" layout="spread" &gt;
>>         &lt;f:selectItem itemValue="1" itemLabel="#{controller.formatLabel('test')}"
escape="false" /&gt;
>> &lt;/t:selectOneRadio&gt;
>>
>> &lt;t:radio index="0" for="idRadioJSF" id="testRADIOJSF0" /&gt;
>>
>>
>> My Method looks like :
>>
>> public String formatLabel(String label){
>>
>>         return  "&lt;span class=\"description\"&gt;"+label+"&lt;/span&gt;"
;
>>
>>  }
>>
>> Browser render it like :
>>
>> &lt;input id="page:tabRepeat:0:parameterRepeat:0:testRADIOJSF0" type="radio"
name="page:tabRepeat:0:parameterRepeat:0:idRadioJSF" value="1" /&gt;
>> &lt;label for="page:tabRepeat:0:parameterRepeat:0:testRADIOJSF0"&gt; &amp;lt;span
class=&amp;quot;description&amp;quot;&amp;gt;test&amp;lt;/span&amp;gt;&lt;/label&gt;
>>
>>
>>
>>  I'm using Myfaces ver 2.1.1 and Tomahawk lib.
>>
>> Regards,
>> Patrick
>>
>>
>>

Mime
View raw message