myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-1897) escape value of a selectItem is never evaluated
Date Fri, 08 Aug 2008 19:35:44 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621022#action_12621022
] 

Leonardo Uribe commented on MYFACES-1897:
-----------------------------------------

Hi Paul

I have some suggestions about the patch provided (myfaces-1897-2.patch):

1. Look jsf tlddoc documentation for 1.2_MR1

http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/tlddocs/

 It is not necessary to modify JSFAttr and SelectItemTagBase, since the code is correct.

2. There was a recent change on tomahawk core 1.2 class HtmlRadioRenderer that calls renderLabel
method, so a new patch including the change on this class is needed. Personally I prefer let
the old method and include a new one with escape capability, rather than remove it, (if it
is necessary put the old one as deprecated).

3. Run the test I provided with jsf ri 1.2_09 (it has the correct behavior for all components).
I can see the solution but only for two components, not all six.

> escape value of a selectItem is never evaluated
> -----------------------------------------------
>
>                 Key: MYFACES-1897
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1897
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.3
>            Reporter: Jörg Rothbarth
>            Assignee: Leonardo Uribe
>         Attachments: myfaces-1897-2.patch, SelectItemEscapeBean.java, selectOneManyEscape.jsp,
tomahawk12-HtmlCheckboxRenderer.patch
>
>
> The escape Attribute of a selectItem Component is not evaluated inside a selectOneRadio
component.
> The selectItem Component has a escape member, but the member is never used. 
> 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);
>     }
> }
> ... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message