You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/12/28 09:45:35 UTC

svn commit: r359444 - /myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java

Author: mmarinschek
Date: Wed Dec 28 00:45:21 2005
New Revision: 359444

URL: http://svn.apache.org/viewcvs?rev=359444&view=rev
Log:
implemented partial validation dependent on button/link actionFor attribute. Resolved the uniqueIdCreation problem.

Modified:
    myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java

Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java?rev=359444&r1=359443&r2=359444&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java Wed Dec 28 00:45:21 2005
@@ -111,41 +111,7 @@
     protected String getClientId(FacesContext facesContext,
                                  UIComponent uiComponent, String forAttr)
     {
-        UIComponent forComponent = uiComponent.findComponent(forAttr);
-        if (forComponent == null)
-        {
-            if (log.isInfoEnabled())
-            {
-                log.info("Unable to find component '" + forAttr +
-                        "' (calling findComponent on component '" + uiComponent.getClientId(facesContext) + "')."+
-                        " We'll try to render out a guessed client-id anyways -"+
-                        " this will be a problem if you put a for-component and its corresponding input "+
-                        " in different naming-containers. If this is the case, you can always use the full client-id.");
-            }
-            if (forAttr.length() > 0 && forAttr.charAt(0) == UINamingContainer.SEPARATOR_CHAR)
-            {
-                //absolute id path
-                return forAttr.substring(1);
-            }
-            else
-            {
-                //relative id path, we assume a component on the same level as the label component
-                String labelClientId = uiComponent.getClientId(facesContext);
-                int colon = labelClientId.lastIndexOf(UINamingContainer.SEPARATOR_CHAR);
-                if (colon == -1)
-                {
-                    return forAttr;
-                }
-                else
-                {
-                    return labelClientId.substring(0, colon + 1)+forAttr;
-                }
-            }
-        }
-        else
-        {
-            return forComponent.getClientId(facesContext);
-        }
+        return RendererUtils.getClientId(facesContext, uiComponent, forAttr);
     }