myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1657957 - in /myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets: FaceletCompositionContext.java impl/FaceletCompositionContextImpl.java impl/SectionUniqueIdCounter.java tag/composite/InterfaceHandler.java
Date Fri, 06 Feb 2015 20:47:56 GMT
Author: lu4242
Date: Fri Feb  6 20:47:56 2015
New Revision: 1657957

URL: http://svn.apache.org/r1657957
Log:
MYFACES-3951 Action not performed on first click

Modified:
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java
    myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java?rev=1657957&r1=1657956&r2=1657957&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
Fri Feb  6 20:47:56 2015
@@ -449,6 +449,25 @@ abstract public class FaceletComposition
     }
     
     /**
+     * Start a new unique id section, which means a new counter is used to
+     * generate unique ids to components, but appending a base to the
+     * new counter.
+     * 
+     * @return
+     */
+    public String startComponentUniqueIdSection(String base)
+    {
+        return null;
+    }
+    
+    /**
+     * @param base 
+     */
+    public void endComponentUniqueIdSection(String base)
+    {
+    }
+    
+    /**
      * Generate a unique id that will be used later to derive a unique id per tag
      * by FaceletContext.generateUniqueId(). This generator ensures uniqueness per
      * view but FaceletContext.generateUniqueId() ensures uniqueness per view and

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java?rev=1657957&r1=1657956&r2=1657957&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
Fri Feb  6 20:47:56 2015
@@ -982,6 +982,13 @@ public class FaceletCompositionContextIm
         _sectionUniqueComponentIdCounter.startUniqueIdSection();
         return _sectionUniqueIdCounter.startUniqueIdSection();
     }
+    
+    public String startComponentUniqueIdSection(String base)
+    {
+        _level++;
+        _sectionUniqueComponentIdCounter.startUniqueIdSection(base);
+        return _sectionUniqueIdCounter.startUniqueIdSection(base);
+    }
 
     @Override
     public void incrementUniqueId()
@@ -1020,6 +1027,13 @@ public class FaceletCompositionContextIm
         _sectionUniqueComponentIdCounter.endUniqueIdSection();
     }
     
+    public void endComponentUniqueIdSection(String base)
+    {
+        _level--;
+        _sectionUniqueIdCounter.endUniqueIdSection(base);
+        _sectionUniqueComponentIdCounter.endUniqueIdSection(base);
+    }
+    
     @Override
     public void startMetadataSection()
     {

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java?rev=1657957&r1=1657956&r2=1657957&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java
Fri Feb  6 20:47:56 2015
@@ -145,7 +145,7 @@ public class SectionUniqueIdCounter
                 _builder.append(lastPrefix);
                 _builder.append('_');
             }
-            appendToBuilder(_counterStack.get(_counterStack.size()-1).getCounter(),
+            appendToBuilder(_counterStack.get(_counterStack.size()-1).getCounter()-1,
                 _radix, _builder, _bufferConversion);
         }
 

Modified: myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java?rev=1657957&r1=1657956&r2=1657957&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java
(original)
+++ myfaces/core/branches/2.1.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/InterfaceHandler.java
Fri Feb  6 20:47:56 2015
@@ -200,8 +200,9 @@ public class InterfaceHandler extends Ta
         // in other words we are calling ViewDeclarationLanguage.getComponentMetadata
         if ( ((AbstractFaceletContext)ctx).isBuildingCompositeComponentMetadata() )
         {
+            FaceletCompositionContext fcc = FaceletCompositionContext.getCurrentInstance(ctx);
             UIComponent compositeBaseParent
-                    = FaceletCompositionContext.getCurrentInstance(ctx).getCompositeComponentFromStack();
+                    = fcc.getCompositeComponentFromStack();
             
             CompositeComponentBeanInfo beanInfo = 
                 (CompositeComponentBeanInfo) compositeBaseParent.getAttributes()
@@ -244,7 +245,16 @@ public class InterfaceHandler extends Ta
             CompositeTagAttributeUtils.addUnspecifiedAttributes(descriptor, tag, 
                     STANDARD_ATTRIBUTES_SORTED, ctx);
             
-            nextHandler.apply(ctx, parent);
+            try
+            {
+                fcc.startComponentUniqueIdSection("__ccmd_");
+                
+                nextHandler.apply(ctx, parent);
+            }
+            finally
+            {
+                fcc.endComponentUniqueIdSection("__ccmd_");
+            }
         }
     }
     



Mime
View raw message