@Override public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { return last.findComponent(expression); } }
/** * Finds the first component by the given id expression or client id. * * @param id The id. * @param base The base component to start the traversal. * @param separatorChar The separatorChar (e.g. :). * @param context The FacesContext. * @param callback the callback for the found component */ public static void firstById(String id, UIComponent base, char separatorChar, FacesContext context, ContextCallback callback) { // try #findComponent first UIComponent component = base.findComponent(id); // try #invokeOnComponent // it's required to support e.g. a full client id for a component which is placed inside UIData components if (component == null) { // #invokeOnComponent doesn't support the leading seperator char String tempExpression = id; if (tempExpression.charAt(0) == separatorChar) { tempExpression = tempExpression.substring(1); } context.getViewRoot().invokeOnComponent(context, tempExpression, callback); } else { callback.invokeContextCallback(context, component); } }
/** * @see javax.faces.component.UIComponent#findComponent(java.lang.String) */ public UIComponent findComponent(String expr) { return parent.findComponent(expr); }
/** * @see javax.faces.component.UIComponent#findComponent(java.lang.String) */ @Override public UIComponent findComponent(String expr) { return parent.findComponent(expr); }
private UIInput findInputComponent(UIComponent parent, String clientId, PropertyKeys property) { UIComponent found = parent.findComponent(clientId); if (found == null) { throw new IllegalArgumentException(format( ERROR_UNKNOWN_COMPONENT, getClass().getSimpleName(), property, clientId)); } else if (!(found instanceof UIInput)) { throw new IllegalArgumentException(format( ERROR_INVALID_COMPONENT, getClass().getSimpleName(), property, clientId, found.getClass().getName())); } return (UIInput) found; }
public static String getConcatenatedId(FacesContext context, UIComponent container, String clientId) { UIComponent child = container.findComponent(clientId); if (child == null) { return clientId; } return getConcatenatedId(context, child); }
private void updateWidthOfColumns(FacesContext context, UIComponent component, String widthString) { if (widthString != null && widthString.length() > 0) { String[] widthArray = widthString.split(","); for (int i = 0; i < widthArray.length; i++) { String[] widthEntry = widthArray[i].split(":"); UIComponent column = component.findComponent(widthEntry[0]); updateAttribute(context, column, "width", widthEntry[1]); } } }
private void updateWidthOfColumns(FacesContext context, UIComponent component, String widthString) { if (widthString != null && widthString.length() > 0) { String[] widthArray = widthString.split(","); for (int i = 0; i < widthArray.length; i++) { String[] widthEntry = widthArray[i].split(":"); UIComponent column = component.findComponent(widthEntry[0]); updateAttribute(context, column, "width", widthEntry[1]); } } }
public static String getConcatenatedId(FacesContext context, UIComponent container, String clientId) { UIComponent child = container.findComponent(clientId); if(child == null) return clientId; return getConcatenatedId(context, child); }
public static String getConcatenatedId(FacesContext context, UIComponent container, String clientId) { UIComponent child = container.findComponent(clientId); if(child == null) return clientId; return getConcatenatedId(context, child); }
public void validateMulti(FacesContext context, UIComponent component, Object value){ ... UIInput minInput = (UIInput) component.findComponent("minYear"); ... context.addMessage("minYear", new FacesMessage(valMsg, valMsg)); ...
private static String getResolvedId(UIComponent component, String id) { UIComponent resolvedComponent = component.findComponent(id); if (resolvedComponent == null) { if (id.charAt(0) == UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance())) { return id.substring(1); } return id; } return resolvedComponent.getClientId(); } }
private static String getResolvedId(UIComponent component, String id) { UIComponent resolvedComponent = component.findComponent(id); if (resolvedComponent == null) { if (id.charAt(0) == UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance())) { return id.substring(1); } return id; } return resolvedComponent.getClientId(); } }
private static String getResolvedId(UIComponent component, String id) { UIComponent resolvedComponent = component.findComponent(id); if (resolvedComponent == null) { if (id.charAt(0) == UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance())) { return id.substring(1); } return id; } return resolvedComponent.getClientId(); } }
private final String getComponentId(ClientBehaviorContext context, String id) { UIComponent contextComponent = context.getComponent(); UIComponent target = contextComponent.findComponent(id); if (target == null) { target = contextComponent.findComponent(COLON + id); } if (target != null) { return target.getClientId(); } throw new FacesException("Component with id:" + id + " not found"); }
public void listenerAddTraining(ActionEvent event) { UIComponent component = event.getComponent(); UIComponent trainingInput = component.findComponent(":document_create:nxl_LayoutStage:objectDocumentTrainingFieldInput"); if(trainingInput == null){ trainingInput = component.findComponent(":document_edit:nxl_LayoutStage:objectDocumentTrainingFieldInput"); } if(trainingInput != null){ String newContactRef = (String) ((UIInput) trainingInput).getSubmittedValue(); addTraining(newContactRef); } }
protected void encodeClientIdProperty(ResponseWriter responseWriter, String propertyName, String clientId, UIComponent uiComponent, boolean first) throws IOException { UIComponent forComponent = uiComponent.findComponent(clientId); String escapedClientId = clientId; if (forComponent != null) { escapedClientId = forComponent.getClientId(); } encodeClientIdProperty(responseWriter, propertyName, escapedClientId, first); }
/* package-private */ static void encodeClientId(ResponseWriter responseWriter, String attributeName, String clientId, UIComponent uiComponent, boolean first) throws IOException { UIComponent forComponent = uiComponent.findComponent(clientId); String escapedClientId = clientId; if (forComponent != null) { escapedClientId = forComponent.getClientId(); } encodeClientId(responseWriter, attributeName, escapedClientId, first); }
@Nullable public HtmlModalPanel getPropSetModalPanel() { UIForm configSetForm = FacesComponentUtility.getEnclosingForm(this); return (HtmlModalPanel) configSetForm.getParent().findComponent(getPropSetModalPanelId(this)); }
@SuppressWarnings({"UnusedDeclaration"}) protected UIComponent findReparentedComponent(FaceletContext ctx, UIComponent parent, String tagId) { UIComponent facet = parent.getFacets().get(UIComponent.COMPOSITE_FACET_NAME); if (facet != null) { UIComponent newParent = facet.findComponent( (String)parent.getAttributes().get(tagId)); if (newParent != null) return ComponentSupport.findChildByTagId(ctx.getFacesContext(), newParent, tagId); } return null; }