Skip to content

Commit

Permalink
Fix #1883: Enhance UIViewRoot#resetValues() to pass VisitHints
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Aug 4, 2024
1 parent 60673af commit d33bc4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions api/src/main/java/jakarta/faces/component/UIViewRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;

Expand All @@ -43,6 +44,7 @@
import jakarta.faces.component.behavior.ClientBehaviorContext;
import jakarta.faces.component.visit.VisitCallback;
import jakarta.faces.component.visit.VisitContext;
import jakarta.faces.component.visit.VisitHint;
import jakarta.faces.component.visit.VisitResult;
import jakarta.faces.context.FacesContext;
import jakarta.faces.context.PartialViewContext;
Expand Down Expand Up @@ -1012,18 +1014,19 @@ public void processDecodes(FacesContext context) {

/**
* <p class="changed_added_2_2">
* Visit the clientIds and, if the component is an instance of {@link EditableValueHolder}, call its
* Visit the clientIds <span class="changed_added_5_0"> with the given visit hints, if any,</span> and, if the component is an instance of {@link EditableValueHolder}, call its
* {@link EditableValueHolder#resetValue} method. Use {@link #visitTree} to do the visiting.
* </p>
*
* @since 2.2
*
* @param context the {@link FacesContext} for the request we are processing.
* @param clientIds The client ids to be visited, on which the described action will be taken.
* @param visitHints Since 5.0: Any visit hints you wish to apply to the visit.
*/

public void resetValues(FacesContext context, Collection<String> clientIds) {
visitTree(VisitContext.createVisitContext(context, clientIds, null), new DoResetValues());
public void resetValues(FacesContext context, Collection<String> clientIds, VisitHint... visitHints) {
visitTree(VisitContext.createVisitContext(context, clientIds, visitHints.length == 0 ? null : Set.of(visitHints)), new DoResetValues());
}

private static class DoResetValues implements VisitCallback {
Expand Down

0 comments on commit d33bc4a

Please sign in to comment.