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:32:28 UTC
svn commit: r738389 - in
/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core:
pda/PdaCommandLinkRenderer.java xhtml/CommandButtonRenderer.java
Author: matzew
Date: Wed Jan 28 07:32:28 2009
New Revision: 738389
URL: http://svn.apache.org/viewvc?rev=738389&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/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java
myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java
Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java?rev=738389&r1=738388&r2=738389&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/pda/PdaCommandLinkRenderer.java Wed Jan 28 07:32:28 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/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java?rev=738389&r1=738388&r2=738389&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandButtonRenderer.java Wed Jan 28 07:32:28 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"
*