You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2022/12/07 13:54:27 UTC

[myfaces] branch 2.3-next updated: reverted - thanks NetBeans for not resetting my temp change

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch 2.3-next
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.3-next by this push:
     new d9987cf1a reverted - thanks NetBeans for not resetting my temp change
d9987cf1a is described below

commit d9987cf1a12ebe0ca52854f795f14b31d6326164
Author: tandraschko <ta...@apache.org>
AuthorDate: Wed Dec 7 14:54:20 2022 +0100

    reverted - thanks NetBeans for not resetting my temp change
---
 .../myfaces/view/facelets/component/UIRepeat.java  | 59 +++++++++++++++++++---
 1 file changed, 53 insertions(+), 6 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java b/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
index 6978bc390..66d3ae0c8 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
@@ -1678,12 +1678,59 @@ public class UIRepeat extends UIComponentBase implements NamingContainer
                 _rowStates.clear();
             }
         }
-
-        Object values[] = new Object[3];
-        values[0] = super.saveState(context);
-        values[1] = null;
-        values[2] = UIComponentBase.saveAttachedState(context, _rowStates);
-        return values;
+        if (initialStateMarked())
+        {
+            Object parentSaved = super.saveState(context);
+            if (context.getCurrentPhaseId() != null && 
+                !PhaseId.RENDER_RESPONSE.equals(context.getCurrentPhaseId()))
+            {
+                if (parentSaved == null /*&&_rowDeltaStates.isEmpty()*/ && _rowStates.isEmpty())
+                {
+                    return null;
+                }
+                else
+                {
+                    Object values[] = new Object[3];
+                    values[0] = super.saveState(context);
+                    values[1] = null;
+                    values[2] = UIComponentBase.saveAttachedState(context, _rowStates);
+                    return values;
+                }
+            }
+            else
+            {
+                if (parentSaved == null)
+                {
+                    return null;
+                }
+                else
+                {
+                    Object values[] = new Object[2];
+                    values[0] = super.saveState(context);
+                    values[1] = null;
+                    return values; 
+                }
+            }
+        }
+        else
+        {
+            if (context.getCurrentPhaseId() != null && 
+                !PhaseId.RENDER_RESPONSE.equals(context.getCurrentPhaseId()))
+            {
+                Object values[] = new Object[3];
+                values[0] = super.saveState(context);
+                values[1] = null;
+                values[2] = UIComponentBase.saveAttachedState(context, _rowStates);
+                return values; 
+            }
+            else
+            {
+                Object values[] = new Object[2];
+                values[0] = super.saveState(context);
+                values[1] = null;
+                return values;
+            }
+        }
     }
     
     @Override