@Override public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { return UIComponent.getCompositeComponentParent(last); } }
compositeParent = UIComponent.getCompositeComponentParent(source);
if (!UIComponent.isCompositeComponent(source)) { compositeParent = UIComponent .getCompositeComponentParent(source);
.getCompositeComponentParent(targetComponent); if (compositeParent != null) { pushComponentToEL(facesContext, compositeParent);
public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { return UIComponent.getCompositeComponentParent(last); } }
private UIComponent getCompositeParent(UIComponent comp) { return UIComponent.getCompositeComponentParent(comp); }
private UIComponent getCompositeParent(UIComponent comp) { return UIComponent.getCompositeComponentParent(comp); }
private UIComponent getCompositeParent(UIComponent comp) { return UIComponent.getCompositeComponentParent(comp); }
private UIComponent getCompositeParent(UIComponent comp) { return UIComponent.getCompositeComponentParent(comp); }
@Override public void resolve(SearchKeywordContext expressionContext, UIComponent current, String keyword) { expressionContext.invokeContextCallback(UIComponent.getCompositeComponentParent(current)); }
@Override public void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword) { searchKeywordContext.invokeContextCallback( UIComponent.getCompositeComponentParent(current)); }
@Override public void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword) { searchKeywordContext.invokeContextCallback( UIComponent.getCompositeComponentParent(current)); }
private static UIComponent getCompositeParent(UIComponent targetComponent) { if (!UIComponent.isCompositeComponent(targetComponent)) { return UIComponent.getCompositeComponentParent(targetComponent); } return null; } }
private static UIComponent getCompositeParent(UIComponent targetComponent) { if (!UIComponent.isCompositeComponent(targetComponent)) { return UIComponent.getCompositeComponentParent(targetComponent); } return null; } }
@Override public void resolve(SearchKeywordContext searchKeywordContext, UIComponent current, String keyword) { searchKeywordContext.invokeContextCallback( UIComponent.getCompositeComponentParent(current)); }
private static UIComponent getCompositeParent(UIComponent targetComponent) { if (!UIComponent.isCompositeComponent(targetComponent)) { return UIComponent.getCompositeComponentParent(targetComponent); } return null; } }
public static UIComponent getCompositeComponentBasedOnLocation(final FacesContext facesContext, UIComponent baseComponent, final Location location) { UIComponent currentComponent = baseComponent; while (currentComponent != null) { Location componentLocation = (Location) currentComponent.getAttributes().get( LOCATION_KEY); if (componentLocation != null && componentLocation.getPath().equals(location.getPath())) { return currentComponent; } // get the composite component's parent currentComponent = UIComponent.getCompositeComponentParent(currentComponent); } return null; }
/** * Returns the value of the <code>label</code> attribute associated with the given UI component if any, else * null. * @param component The UI component for which the label is to be retrieved. * @return The value of the <code>label</code> attribute associated with the given UI component if any, else * null. */ public static String getOptionalLabel(UIComponent component) { Object[] result = new Object[1]; new ScopedRunner(getContext()).with("cc", getCompositeComponentParent(component)).invoke(() -> { Object label = component.getAttributes().get(ATTRIBUTE_LABEL); if (isEmpty(label)) { ValueExpression labelExpression = component.getValueExpression(ATTRIBUTE_LABEL); if (labelExpression != null) { label = labelExpression.getValue(getELContext()); } } result[0] = label; }); return (result[0] != null) ? result[0].toString() : null; }
/** * Returns the value of the <code>label</code> attribute associated with the given UI component if any, else * null. * @param component The UI component for which the label is to be retrieved. * @return The value of the <code>label</code> attribute associated with the given UI component if any, else * null. */ public static String getOptionalLabel(UIComponent component) { Object[] result = new Object[1]; new ScopedRunner(getContext()).with("cc", getCompositeComponentParent(component)).invoke(() -> { Object label = component.getAttributes().get(ATTRIBUTE_LABEL); if (isEmpty(label)) { ValueExpression labelExpression = component.getValueExpression(ATTRIBUTE_LABEL); if (labelExpression != null) { label = labelExpression.getValue(getELContext()); } } result[0] = label; }); return (result[0] != null) ? result[0].toString() : null; }
/** * Create a {@link javax.faces.validator.Validator} based on the <code>binding</code> and/or * <code>validatorId</code> attributes as per the standard JSF <code><f:validator></code> implementation and * collect the render time attributes. Then create an anonymous <code>Validator</code> implementation which wraps * the created <code>Validator</code> and delegates the methods to it after setting the render time attributes only * and only if the <code>disabled</code> attribute evaluates <code>true</code> for the current request. Finally set * the anonymous implementation on the parent component. * @param context The involved facelet context. * @param parent The parent component to add the <code>Validator</code> to. * @throws IOException If something fails at I/O level. */ @Override public void apply(FaceletContext context, UIComponent parent) throws IOException { boolean insideCompositeComponent = UIComponent.getCompositeComponentParent(parent) != null; if (!ComponentHandler.isNew(parent) && !insideCompositeComponent) { // If it's not new nor inside a composite component, we're finished. return; } if (!(parent instanceof EditableValueHolder) || (insideCompositeComponent && getAttribute("for") == null)) { // It's inside a composite component and not reattached. TagHandlerDelegate will pickup it and pass the target component back if necessary. super.apply(context, parent); return; } addValidator(context, (EditableValueHolder) parent); }