myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r779441 - /myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java
Date Thu, 28 May 2009 05:27:46 GMT
Author: lu4242
Date: Thu May 28 05:27:46 2009
New Revision: 779441

URL: http://svn.apache.org/viewvc?rev=779441&view=rev
Log:
Write params using f:param child component is only for HtmlTag instances

Modified:
    myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java

Modified: myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java?rev=779441&r1=779440&r2=779441&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java
(original)
+++ myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/htmlTag/HtmlTagRenderer.java
Thu May 28 05:27:46 2009
@@ -72,14 +72,19 @@
             String[] supportedAttributes = {HTML.STYLE_CLASS_ATTR, HTML.STYLE_ATTR};
             HtmlRendererUtils.renderHTMLAttributes(writer, htmlTag, supportedAttributes);
             
-            // write additional attributes supplied by f:param tags
-            Map params = getParameterMap(htmlTag);
-            for(Iterator iter = params.entrySet().iterator(); iter.hasNext();)
+            if (htmlTag.getClass().equals(HtmlTag.class))
             {
-                Entry param = (Entry) iter.next();
-                if (null != param.getValue())
+                // write additional attributes supplied by f:param tags
+                // Components that extend from HtmlTag component should render attributes
+                // on a proper encodeBegin (see Div component for details) 
+                Map params = getParameterMap(htmlTag);
+                for(Iterator iter = params.entrySet().iterator(); iter.hasNext();)
                 {
-                    writer.writeAttribute(param.getKey().toString(), param.getValue().toString(),
null);
+                    Entry param = (Entry) iter.next();
+                    if (null != param.getValue())
+                    {
+                        writer.writeAttribute(param.getKey().toString(), param.getValue().toString(),
null);
+                    }
                 }
             }
         }



Mime
View raw message