You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "melloware (via GitHub)" <gi...@apache.org> on 2024/07/21 14:40:45 UTC

[PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

melloware opened a new pull request, #730:
URL: https://github.com/apache/myfaces/pull/730

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on PR #730:
URL: https://github.com/apache/myfaces/pull/730#issuecomment-2259786122

   @melloware wanna port my commit to 4.1 and 4.0?
   no feedback from balusc right now but its the right way, no matter how implemented exactly we need to reset all


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "melloware (via GitHub)" <gi...@apache.org>.
melloware commented on PR #730:
URL: https://github.com/apache/myfaces/pull/730#issuecomment-2260337055

   yep i will look at what you did in 5.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "melloware (via GitHub)" <gi...@apache.org>.
melloware closed pull request #730: MYFACES-4675: 4.0 ResetValues visit tree
URL: https://github.com/apache/myfaces/pull/730


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "melloware (via GitHub)" <gi...@apache.org>.
melloware commented on code in PR #730:
URL: https://github.com/apache/myfaces/pull/730#discussion_r1686997683


##########
impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java:
##########
@@ -579,6 +579,11 @@ public VisitResult visit(VisitContext context, UIComponent target)
             {
                 ((EditableValueHolder)target).resetValue();
             }
+            else if (!VisitContext.ALL_IDS.equals(context.getIdsToVisit()))
+            {
+                // Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
+                target.visitTree(VisitContext.createVisitContext(FacesContext.getCurrentInstance(), null, context.getHints()), this);

Review Comment:
   OK @tandraschko i might need a hint on this one.  PF does his slighlty differnetly by just calling visitTree where in this case BalusC specifically creates a new VisitContext?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on code in PR #730:
URL: https://github.com/apache/myfaces/pull/730#discussion_r1686490745


##########
impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java:
##########
@@ -579,6 +579,11 @@ public VisitResult visit(VisitContext context, UIComponent target)
             {
                 ((EditableValueHolder)target).resetValue();
             }
+            else if (!VisitContext.ALL_IDS.equals(context.getIdsToVisit()))
+            {
+                // Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
+                target.visitTree(VisitContext.createVisitContext(FacesContext.getCurrentInstance(), null, context.getHints()), this);

Review Comment:
   and please create a unit test for it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on code in PR #730:
URL: https://github.com/apache/myfaces/pull/730#discussion_r1686490287


##########
impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java:
##########
@@ -579,6 +579,11 @@ public VisitResult visit(VisitContext context, UIComponent target)
             {
                 ((EditableValueHolder)target).resetValue();
             }
+            else if (!VisitContext.ALL_IDS.equals(context.getIdsToVisit()))
+            {
+                // Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
+                target.visitTree(VisitContext.createVisitContext(FacesContext.getCurrentInstance(), null, context.getHints()), this);

Review Comment:
   can we make the visitContext static or reuseable?
   currently this would create tons of the same context object, not quite good from performance perspective
   just look at PF one



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "melloware (via GitHub)" <gi...@apache.org>.
melloware commented on code in PR #730:
URL: https://github.com/apache/myfaces/pull/730#discussion_r1686498845


##########
impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java:
##########
@@ -579,6 +579,11 @@ public VisitResult visit(VisitContext context, UIComponent target)
             {
                 ((EditableValueHolder)target).resetValue();
             }
+            else if (!VisitContext.ALL_IDS.equals(context.getIdsToVisit()))
+            {
+                // Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
+                target.visitTree(VisitContext.createVisitContext(FacesContext.getCurrentInstance(), null, context.getHints()), this);

Review Comment:
   i saw that about the FacesContext but was trying not to make the change too invasive. I will rework this today.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on PR #730:
URL: https://github.com/apache/myfaces/pull/730#issuecomment-2243777369

   could you create a unit test first that fails currently?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "melloware (via GitHub)" <gi...@apache.org>.
melloware commented on PR #730:
URL: https://github.com/apache/myfaces/pull/730#issuecomment-2243800103

   Failing test case added where it resets `render="@form"`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on PR #730:
URL: https://github.com/apache/myfaces/pull/730#issuecomment-2243777547

   see ResetValuesTestCase


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MYFACES-4675: 4.0 ResetValues visit tree [myfaces]

Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko commented on code in PR #730:
URL: https://github.com/apache/myfaces/pull/730#discussion_r1686517795


##########
impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java:
##########
@@ -579,6 +579,11 @@ public VisitResult visit(VisitContext context, UIComponent target)
             {
                 ((EditableValueHolder)target).resetValue();
             }
+            else if (!VisitContext.ALL_IDS.equals(context.getIdsToVisit()))
+            {
+                // Render ID didn't specifically point an EditableValueHolder. Visit all children as well.
+                target.visitTree(VisitContext.createVisitContext(FacesContext.getCurrentInstance(), null, context.getHints()), this);

Review Comment:
   yeah sure
   ping if you need help



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org