You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/03/11 16:36:59 UTC

svn commit: r921900 - in /myfaces/core/trunk: api/src/main/java/javax/faces/component/UIComponentBase.java impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java

Author: lu4242
Date: Thu Mar 11 15:36:59 2010
New Revision: 921900

URL: http://svn.apache.org/viewvc?rev=921900&view=rev
Log:
MYFACES-2598 UIViewParameter does not get an automatic id

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java?rev=921900&r1=921899&r2=921900&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java Thu Mar 11 15:36:59 2010
@@ -690,7 +690,7 @@ public abstract class UIComponentBase ex
         if (_clientId != null)
             return _clientId;
 
-        boolean idWasNull = false;
+        //boolean idWasNull = false;
         String id = getId();
         if (id == null)
         {
@@ -724,7 +724,7 @@ public abstract class UIComponentBase ex
             }
             setId(id);
             // We remember that the id was null and log a warning down below
-            idWasNull = true;
+            // idWasNull = true;
         }
 
         UIComponent namingContainer = _ComponentUtils.findParentNamingContainer(this, false);
@@ -752,15 +752,18 @@ public abstract class UIComponentBase ex
             _clientId = renderer.convertClientId(context, _clientId);
         }
 
-        if (idWasNull && log.isLoggable(Level.WARNING))
-        {
-            log.warning("WARNING: Component " + _clientId
-                    + " just got an automatic id, because there was no id assigned yet. "
-                    + "If this component was created dynamically (i.e. not by a JSP tag) you should assign it an "
-                    + "explicit static id or assign it the id you get from "
-                    + "the createUniqueId from the current UIViewRoot "
-                    + "component right after creation! Path to Component: " + getPathToComponent(this));
-        }
+        // -=Leonardo Uribe=- In jsf 1.1 and 1.2 this warning has sense, but in jsf 2.0 it is common to have
+        // components without any explicit id (UIViewParameter components and UIOuput resource components) instances.
+        // So, this warning is becoming obsolete in this new context and should be removed.
+        //if (idWasNull && log.isLoggable(Level.WARNING))
+        //{
+        //    log.warning("WARNING: Component " + _clientId
+        //            + " just got an automatic id, because there was no id assigned yet. "
+        //            + "If this component was created dynamically (i.e. not by a JSP tag) you should assign it an "
+        //            + "explicit static id or assign it the id you get from "
+        //            + "the createUniqueId from the current UIViewRoot "
+        //            + "component right after creation! Path to Component: " + getPathToComponent(this));
+        //}
 
         return _clientId;
     }

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java?rev=921900&r1=921899&r2=921900&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java Thu Mar 11 15:36:59 2010
@@ -99,23 +99,11 @@ final class DefaultFacelet extends Facel
             FaceletException, ELException
     {
         DefaultFaceletContext ctx = new DefaultFaceletContext(facesContext, this);
-        // push the parent as a UniqueIdVendor to the stack here
-        if (parent instanceof UniqueIdVendor)
-        {
-            ctx.pushUniqueIdVendorToStack((UniqueIdVendor) parent);
-        }
-        
         this.refresh(parent);
         ComponentSupport.markForDeletion(parent);
         _root.apply(ctx, parent);
         ComponentSupport.finalizeForDeletion(parent);
         this.markApplied(parent);
-        
-        // remove the UIViewRoot from the UniqueIdVendor stack
-        if (parent instanceof UniqueIdVendor)
-        {
-            ctx.popUniqueIdVendorToStack();
-        }
     }
 
     private final void refresh(UIComponent c)