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 2006/02/21 18:07:52 UTC

svn commit: r379534 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java

Author: mmarinschek
Date: Tue Feb 21 09:07:49 2006
New Revision: 379534

URL: http://svn.apache.org/viewcvs?rev=379534&view=rev
Log:
small bug fix

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java?rev=379534&r1=379533&r2=379534&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/subform/SubForm.java Tue Feb 21 09:07:49 2006
@@ -71,7 +71,7 @@
 
         boolean partialEnabled = isPartialEnabled(context, PhaseId.PROCESS_VALIDATIONS);
 
-        if(partialEnabled || _submitted)
+        if(partialEnabled || (_submitted && isEmptyList(context)))
         {
             for (Iterator it = getFacetsAndChildren(); it.hasNext(); )
             {
@@ -159,13 +159,22 @@
         super.queueEvent(event);
     }
 
+    protected boolean isEmptyList(FacesContext context)
+    {
+        //get the list of (parent) client-ids for which a validation/model update should be performed
+        List li = (List) context.getExternalContext().getRequestMap().get(
+                RendererUtils.ACTION_FOR_LIST);
+
+        return li==null || li.size()==0;
+    }
+
     /**Sets up information if this component is included in
      * the group of components which are associated with the current action.
      *
      * @param context
      * @return true if there has been a change by this setup which has to be undone after the phase finishes.
      */
-    private boolean isPartialEnabled(FacesContext context, PhaseId phaseId)
+    protected boolean isPartialEnabled(FacesContext context, PhaseId phaseId)
     {
         //we want to execute validation (and model update) only
         //if certain conditions are met