You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2008/08/04 20:40:44 UTC

[jira] Commented: (MYFACES-1762) h:messages - error while rendering id and styleClass attributes

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

Leonardo Uribe commented on MYFACES-1762:
-----------------------------------------

After checking this bug (multiple html tags with the same id), the conclusion is that this issue should be solved in myfaces core 1.1 and 1.2.

The solution should be modify the renderers, rather than play with the component attribute map. After looking several solutions, the best is add a param to method renderSingleFacesMessage of HtmlMessageRendererBase called renderId, which could be used for avoid render the id when it is used in HtmlMessagesRendererBase. Obviously, backward compatibility must be maintained using this:

    protected void renderSingleFacesMessage(FacesContext facesContext,
                                            UIComponent message,
                                            FacesMessage facesMessage,
                                            String messageClientId)
            throws IOException
    {
        renderSingleFacesMessage(facesContext, message, facesMessage, messageClientId,true);
    }

    protected void renderSingleFacesMessage(FacesContext facesContext,
                                            UIComponent message,
                                            FacesMessage facesMessage,
                                            String messageClientId,
                                            boolean renderId)
            throws IOException
    {



> h:messages - error while rendering id and styleClass attributes
> ---------------------------------------------------------------
>
>                 Key: MYFACES-1762
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1762
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions:  1.1.6-SNAPSHOT
>         Environment: windows, jdk16, jetty, maven
>            Reporter: Antoni Jakubiak
>         Attachments: HtmlMessagesRenderer.java
>
>
> There is an error while rendering "id" and "styleClass" attributes on "h:messages" component.
> For example:
> <h:messages id="messagesId" styleClass="messagesClass" ...
> is rendered as:
> <ul id="messagesId"><li><span id="messagesId" style="messagesClass" >....</span></li><li><span id="messagesId" style="messagesClass" >
> As you can see:
> * in genereted html we have many tags with the same id attribute, 
> * styleClass attribute is rendered as style not as class attribute.
> Regards
> Antoni Jakubiak

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