/** * Remove resource from head and target. */ private void removeResource(FacesContext context, UIComponent resource, UIViewRoot view) { view.removeComponentResource(context, resource, HEAD); view.removeComponentResource(context, resource, TARGET); } }
public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * Remove resource from head and target. */ private void removeResource(FacesContext context, UIComponent resource, UIViewRoot view) { view.removeComponentResource(context, resource, HEAD); view.removeComponentResource(context, resource, TARGET); } }
/** * Remove resource from head and target. */ private void removeResource(FacesContext context, UIComponent resource, UIViewRoot view) { view.removeComponentResource(context, resource, HEAD); view.removeComponentResource(context, resource, TARGET); } }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
/** * <p class="changed_added_2_0">Remove argument <code>component</code>, * which is assumed to represent a resource instance, as a resource * to this view.</p> * * <div class="changed_added_2_0"> * <p> * * @param context {@link FacesContext} for the current request * @param componentResource The {@link UIComponent} representing a * {@link javax.faces.application.Resource} instance * * </p> * </div> * * @since 2.0 */ public void removeComponentResource(FacesContext context, UIComponent componentResource) { removeComponentResource(context, componentResource, null); }
private static void removeComponentResources(FacesContext context, List<UIComponent> componentResourcesToRemove, String target) { UIViewRoot view = context.getViewRoot(); for (UIComponent resourceToRemove : componentResourcesToRemove) { if (resourceToRemove != null) { UIComponent container = isMyFacesUsed() ? resourceToRemove.getParent() : resourceToRemove; // setInView(false) forces JSF to not save dynamic remove action in state. // Otherwise JSF will re-execute dynamic remove during restore view phase. // This is unnecessary as CombinedResourceHandler already takes care of it. // See also https://github.com/omnifaces/omnifaces/issues/135 container.setInView(false); view.removeComponentResource(context, resourceToRemove, target); container.setInView(true); } } }
private static void removeComponentResources(FacesContext context, List<UIComponent> componentResourcesToRemove, String target) { UIViewRoot view = context.getViewRoot(); for (UIComponent resourceToRemove : componentResourcesToRemove) { if (resourceToRemove != null) { UIComponent container = isMyFacesUsed() ? resourceToRemove.getParent() : resourceToRemove; // setInView(false) forces JSF to not save dynamic remove action in state. // Otherwise JSF will re-execute dynamic remove during restore view phase. // This is unnecessary as CombinedResourceHandler already takes care of it. // See also https://github.com/omnifaces/omnifaces/issues/135 container.setInView(false); view.removeComponentResource(context, resourceToRemove, target); container.setInView(true); } } }
protected void moveResources(FacesContext ctx, UIViewRoot root, List<UIComponent> resources, String removeFrom, String addTo, String message) { // push target resources List<UIComponent> existing = new ArrayList<UIComponent>(root.getComponentResources(ctx, addTo)); for (UIComponent r : resources) { ComponentUtils.setRelocated(r); root.removeComponentResource(ctx, r, removeFrom); root.addComponentResource(ctx, r, addTo); logResourceInfo(r, message); } // add them back again for head resources to be still before them for (UIComponent r : existing) { root.addComponentResource(ctx, r, addTo); } }
protected void doOrphanedChildCleanup(FaceletContext ctx, UIComponent parent, UIComponent c) { FacesContext context = ctx.getFacesContext(); boolean suppressEvents = ComponentSupport.suppressViewModificationEvents(context); if (suppressEvents) { // if the component has already been found, it will be removed // and added back to the view. We don't want to publish events // for this case. context.setProcessingEvents(false); } ComponentSupport.finalizeForDeletion(c); UIViewRoot root = context.getViewRoot(); root.removeComponentResource(context, c, getLocationTarget(ctx)); if (suppressEvents) { // restore the original state context.setProcessingEvents(true); } }
@Override protected void doOrphanedChildCleanup(FaceletContext ctx, UIComponent parent, UIComponent c) { FacesContext context = ctx.getFacesContext(); boolean suppressEvents = ComponentSupport.suppressViewModificationEvents(context); if (suppressEvents) { // if the component has already been found, it will be removed // and added back to the view. We don't want to publish events // for this case. context.setProcessingEvents(false); } ComponentSupport.finalizeForDeletion(c); UIViewRoot root = context.getViewRoot(); root.removeComponentResource(context, c, getLocationTarget(ctx)); if (suppressEvents) { // restore the original state context.setProcessingEvents(true); } }
@Override protected void doOrphanedChildCleanup(FaceletContext ctx, UIComponent parent, UIComponent c) { FacesContext context = ctx.getFacesContext(); boolean suppressEvents = ComponentSupport.suppressViewModificationEvents(context); if (suppressEvents) { // if the component has already been found, it will be removed // and added back to the view. We don't want to publish events // for this case. context.setProcessingEvents(false); } ComponentSupport.finalizeForDeletion(c); UIViewRoot root = context.getViewRoot(); root.removeComponentResource(context, c, getLocationTarget(ctx)); if (suppressEvents) { // restore the original state context.setProcessingEvents(true); } }