myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r600193 - /myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java
Date Sat, 01 Dec 2007 20:50:31 GMT
Author: lu4242
Date: Sat Dec  1 12:50:30 2007
New Revision: 600193

URL: http://svn.apache.org/viewvc?rev=600193&view=rev
Log:
Fixes MYFACES-1770 components inside c:forEach has wrong id generation

Modified:
    myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java

Modified: myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java?rev=600193&r1=600192&r2=600193&view=diff
==============================================================================
--- myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java
(original)
+++ myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java
Sat Dec  1 12:50:30 2007
@@ -1144,6 +1144,7 @@
             if (isInAnIterator)
             {
                 setId(createNextId(id));
+                id = getId();
             }
             else
             {
@@ -1183,11 +1184,12 @@
     {
         Integer currentCounter = (Integer) getFacesContext().getExternalContext().getRequestMap().get(componentId);
 
-        int iCurrentCounter = 0;
+        int iCurrentCounter = 1;
 
         if (currentCounter != null)
         {
             iCurrentCounter = currentCounter.intValue();
+            iCurrentCounter++;
         }
 
         getFacesContext().getExternalContext().getRequestMap().put(componentId, new Integer(iCurrentCounter));
@@ -1201,7 +1203,7 @@
     {
         Set<String> previousJspIdsSet = getPreviousJspIdsSet();
 
-        if (previousJspIdsSet.contains(jspId) && isIncludedOrForwarded())
+        if (previousJspIdsSet.contains(jspId) || isIncludedOrForwarded())
         {
             isInAnIterator = true;
         }
@@ -1220,6 +1222,10 @@
         if (previousJspIdsSet == null)
         {
             previousJspIdsSet = new HashSet<String>();
+            //Add it to the context! The next time is called
+            //this method it takes the ref from the RequestContext
+            getFacesContext().getExternalContext().getRequestMap()
+                .put(PREVIOUS_JSP_IDS_SET, previousJspIdsSet);
         }
 
         return previousJspIdsSet;



Mime
View raw message