You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thai Ha (JIRA)" <de...@myfaces.apache.org> on 2007/03/05 01:44:50 UTC

[jira] Created: (MYFACES-1555) h:messages and h:message don't use style attribute when rendering

h:messages and h:message don't use style attribute when rendering
-----------------------------------------------------------------

                 Key: MYFACES-1555
                 URL: https://issues.apache.org/jira/browse/MYFACES-1555
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 1.1.5,  1.1.6-SNAPSHOT, 1.2.0-SNAPSHOT
            Reporter: Thai Ha
            Priority: Minor


When I use 
<h:messages layout="table" showSummary="false" showDetail="true" style="color: red"></h:messages>
the style attribute has no effect on generated html.
If I change it to
<h:messages layout="table" showSummary="false" showDetail="true" errorStyle="color: red"></h:messages>
then it works correctly.

I have looked at the code and here is the cause:

File: HtmlMessagesRendererBase.java (org/apache/myfaces/shared/renderkit/html/HtmlMessagesRendererBase.java)
Lines: 199-202
Code:
            if (style == null)
            {
                style = (String)attr.get(org.apache.myfaces.shared.renderkit.JSFAttr.STYLE_CLASS_ATTR);
            }

I believe that the attribute to be used here must be JSFAttr.STYLE_ATTR (not JSFAttr.STYLE_CLASS_ATTR)

This fix should apply to HtmlMessageRendererBase.java too because h:message has the same problem.


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