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/26 13:48:09 UTC

svn commit: r359065 - /myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java

Author: mmarinschek
Date: Mon Dec 26 04:48:03 2005
New Revision: 359065

URL: http://svn.apache.org/viewcvs?rev=359065&view=rev
Log:
we should only find components in the same parent-tag - and not of the same naming container.

Modified:
    myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java

Modified: myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java?rev=359065&r1=359064&r2=359065&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/webapp/UIComponentTag.java Mon Dec 26 04:48:03 2005
@@ -541,7 +541,7 @@
         {
             //Child
             String id = getOrCreateUniqueId(context);
-            _componentInstance = parent.findComponent(id);
+            _componentInstance = findComponent(parent,id);
             if (_componentInstance == null)
             {
                 _componentInstance = createComponentInstance(context, id);
@@ -564,6 +564,22 @@
             addChildIdToParentTag(parentTag, id);
             return _componentInstance;
         }
+    }
+
+    private UIComponent findComponent(UIComponent parent, String id)
+    {
+        List li = parent.getChildren();
+
+        for (int i = 0; i < li.size(); i++)
+        {
+            UIComponent uiComponent = (UIComponent) li.get(i);
+            if(uiComponent.getId()!=null && uiComponent.getId().equals(id))
+            {
+                return uiComponent;
+            }
+        }
+
+        return null;
     }
 
     /**