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/08/29 05:41:15 UTC

svn commit: r264045 - /myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java

Author: mmarinschek
Date: Sun Aug 28 20:41:11 2005
New Revision: 264045

URL: http://svn.apache.org/viewcvs?rev=264045&view=rev
Log:
Fix for MYFACES-454. Thanks to Shinsuke SUGAYA for supplying this patch.

Modified:
    myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java

Modified: myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java?rev=264045&r1=264044&r2=264045&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/component/UIViewRoot.java Sun Aug 28 20:41:11 2005
@@ -27,6 +27,7 @@
 import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
 import javax.faces.render.RenderKitFactory;
+import javax.portlet.RenderResponse;
 
 /**
  * see Javadoc of JSF Specification
@@ -176,7 +177,14 @@
 
     public String createUniqueId()
     {
-        return UNIQUE_ID_PREFIX + _uniqueIdCounter++;
+        String namespace = "";
+        if(FacesContext.getCurrentInstance().getExternalContext().getResponse() instanceof RenderResponse)
+        {
+            RenderResponse response=(RenderResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
+            namespace = "_" + response.getNamespace();
+        }
+
+        return UNIQUE_ID_PREFIX + namespace + _uniqueIdCounter++;
     }
 
     public Locale getLocale()
@@ -210,7 +218,8 @@
     /**
      * Create Locale from String representation.
      *
-     * @see http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html
+     * http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html
+     *
      * @param locale locale representation in String.
      * @return Locale instance
      */
@@ -304,4 +313,4 @@
         _viewId = (String)values[3];
     }
     //------------------ GENERATED CODE END ---------------------------------------
-}
\ No newline at end of file
+}