You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2009/01/28 08:38:22 UTC

svn commit: r738392 - in /myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core: pda/PdaCommandLinkRenderer.java xhtml/CommandButtonRenderer.java

Author: matzew
Date: Wed Jan 28 07:38:21 2009
New Revision: 738392

URL: http://svn.apache.org/viewvc?rev=738392&view=rev
Log:
TRINIDAD-1379 In HTML basic browsers, attribute id is not supported for <tr:commandButton> and <tr:commandLink> 

thx to Mamallan Uthaman  for the patch

Modified:
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java
    myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java?rev=738392&r1=738391&r2=738392&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java Wed Jan 28 07:38:21 2009
@@ -128,5 +128,30 @@
     rw.endElement(element);
     arc.setCurrentClientId(null);
   }
+  
+  /**
+   * Renders the client ID as both "id" and "name"
+   * @param context the FacesContext object
+   * @param component the UIComponent object
+   * @throws IOException
+   */
+  @Override
+  protected void renderId(
+    FacesContext context,
+    UIComponent  component) throws IOException
+  { 
+    if (shouldRenderId(context, component))
+    {
+      String clientId = getClientId(context, component);
+      context.getResponseWriter().writeURIAttribute("id", clientId, "id");
+      RenderingContext arc = RenderingContext.getCurrentInstance();
+      // For Non-JavaScript browsers, name attribute is handled separately 
+      // so skip it here
+      if (supportsScripting(arc))
+      {
+        context.getResponseWriter().writeURIAttribute("name", clientId, "id");
+      }
+    } 
+  }
 
 }

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java?rev=738392&r1=738391&r2=738392&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java Wed Jan 28 07:38:21 2009
@@ -313,6 +313,31 @@
   }
 
   /**
+   * Renders the client ID as both "id" and "name"
+   * @param context the FacesContext object
+   * @param component the UIComponent object
+   * @throws IOException
+   */
+  @Override
+  protected void renderId(
+    FacesContext context,
+    UIComponent  component) throws IOException
+  { 
+    if (shouldRenderId(context, component))
+    {
+      String clientId = getClientId(context, component);
+      context.getResponseWriter().writeURIAttribute("id", clientId, "id");
+      RenderingContext arc = RenderingContext.getCurrentInstance();
+      // For Non-JavaScript browsers, name attribute is handled separately 
+      // so skip it here
+      if (supportsScripting(arc))
+      {
+        context.getResponseWriter().writeURIAttribute("name", clientId, "id");
+      }
+    } 
+  }
+  
+  /**
    * Returns true if the agent supports the "onclick" JS Handler in an "input" 
    * HTML element of type "image"
    *