incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r475309 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java
Date Wed, 15 Nov 2006 17:08:53 GMT
Author: awiner
Date: Wed Nov 15 09:08:52 2006
New Revision: 475309

URL: http://svn.apache.org/viewvc?view=rev&rev=475309
Log:
ADFFACES-152: HtmlCommandButtonRenderer does not encode image url.  Take 2 - use CoreRenderer.toUri()
in addition to encoding with ExternalContext.  Also, use CoreRenderer.toString() instead of
some casts to String.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java?view=diff&rev=475309&r1=475308&r2=475309
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/HtmlCommandButtonRenderer.java
Wed Nov 15 09:08:52 2006
@@ -13,6 +13,7 @@
 import javax.faces.render.Renderer;
 
 import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.render.CoreRenderer;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.AutoSubmitUtils;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils;
 
@@ -36,7 +37,7 @@
     Map<String, Object> attrs = component.getAttributes();
     UICommand command = (UICommand) component;
     // Which button type (SUBMIT, RESET, or BUTTON) should we generate?
-    String type = (String) attrs.get("type");
+    String type = CoreRenderer.toString(attrs.get("type"));
     if (type == null) 
     {
       type = "submit";
@@ -44,10 +45,9 @@
 
     ResponseWriter writer = context.getResponseWriter();
    
-    Object value = command.getValue();
-    String label = (value != null) ? value.toString() : "";
+    String label = CoreRenderer.toString(command.getValue());
    
-    String imageSrc = (String) attrs.get("image");
+    String imageSrc = CoreRenderer.toUri("image");
     writer.startElement("input", component);
     String id = component.getClientId(context);
     writer.writeAttribute("id", id, "id");
@@ -70,7 +70,7 @@
               null/*no event*/,
               null,
               false/* return false*/);
-    String onclick = (String) attrs.get("onclick");
+    String onclick = CoreRenderer.toString(attrs.get("onclick"));
     script = XhtmlUtils.getChainedJS(onclick, script, true);
 
     writer.writeAttribute("onclick", script, null);



Mime
View raw message