public UIComponent getDataSourceComponent() { if (dataSourceComponent == null) { FacesContext context = getFacesContext(); String tableId = SearchExpressionFacade.resolveClientIds(context, this, getDatasource()); dataSourceComponent = context.getViewRoot().findComponent(tableId); } return dataSourceComponent; }
facesContext.getExternalContext().getRequestMap().put(PPR_INITIALIZED, Boolean.TRUE); fi.getFormName())) facesContext.getExternalContext().getRequestMap().put(PPR_INITIALIZED + "." + fi.getFormName(), if(partialTriggerComponent == null) partialTriggerComponent = FacesContext.getCurrentInstance().getViewRoot().findComponent(partialTriggerId);
UIComponent c = facesContext.getViewRoot().findComponent(currentId); while (c != null && !showIt) { for (String parentId : parentIds) { messages.put(FacesMessage.SEVERITY_FATAL, new ArrayList<FacesMessage>()); // Bootstrap fatal error messages.put(FacesMessage.SEVERITY_ERROR, new ArrayList<FacesMessage>()); // Bootstrap error messages.put(FacesMessage.SEVERITY_WARN, new ArrayList<FacesMessage>()); // Bootstrap warning messages.put(FacesMessage.SEVERITY_INFO, new ArrayList<FacesMessage>()); // Bootstrap info
/** * Gets the current thread-safe TimelineUpdater instance by Id. * * @param id Id of the Timeline component in terms of findComponent() * @return TimelineUpdater instance. * @throws FacesException if the Timeline component can not be found by the given Id */ public static TimelineUpdater getCurrentInstance(String id) { FacesContext fc = FacesContext.getCurrentInstance(); @SuppressWarnings("unchecked") Map<String, TimelineUpdater> map = (Map<String, TimelineUpdater>) fc.getAttributes().get(TimelineUpdater.class.getName()); if (map == null) { return null; } UIComponent timeline = fc.getViewRoot().findComponent(id); if (timeline == null || !(timeline instanceof Timeline)) { throw new FacesException("Timeline component with Id " + id + " was not found"); } TimelineUpdater timelineUpdater = map.get(((Timeline) timeline).resolveWidgetVar()); if (timelineUpdater != null) { timelineUpdater.id = id; } return timelineUpdater; }
UIComponent c = facesContext.getViewRoot().findComponent(currentId); while (c != null && !showIt) { for (String parentId : parentIds) { messages.put(FacesMessage.SEVERITY_FATAL, new ArrayList<FacesMessage>()); // Bootstrap fatal error messages.put(FacesMessage.SEVERITY_ERROR, new ArrayList<FacesMessage>()); // Bootstrap error messages.put(FacesMessage.SEVERITY_WARN, new ArrayList<FacesMessage>()); // Bootstrap warning messages.put(FacesMessage.SEVERITY_INFO, new ArrayList<FacesMessage>()); // Bootstrap info
StringBuilder sb = new StringBuilder(); Timeline timeline = (Timeline) fc.getViewRoot().findComponent(id); TimelineRenderer timelineRenderer = ComponentUtils.getUnwrappedRenderer( fc,
UIData dataTable = (UIData) FacesContext.getCurrentInstance().getViewRoot().findComponent(dataTableId); if (dataTable == null) FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(dataTableVar, oldValue);
public static UIComponent findComponent(String expr) { return FacesContext.getCurrentInstance(). getViewRoot().findComponent(expr); }
public boolean isInComponentTree() { return FacesContext.getCurrentInstance().getViewRoot().findComponent(clientId) != null; }
public boolean isInComponentTree() { return FacesContext.getCurrentInstance().getViewRoot().findComponent(clientId) != null; }
public boolean isInComponentTree() { return FacesContext.getCurrentInstance().getViewRoot().findComponent(clientId) != null; }
@Override public UIComponent get(Object key) { if ( !(key instanceof String) ) return null; try { FacesContext context = FacesContext.getCurrentInstance(); if (context == null) { return null; } UIViewRoot viewRoot = context.getViewRoot(); if (viewRoot == null) { return null; } return viewRoot.findComponent( (String) key ); } catch (IllegalArgumentException iae) { return null; } }
public static String outputClientId(String expr) { FacesContext ctx = FacesContext.getCurrentInstance(); return ctx.getViewRoot().findComponent(expr).getClientId(ctx); } }
protected UIComponent findComponent(final ValidationContext validationContext, final String compId) { FacesContext context = validationContext.getFacesContext(); UIComponent comp = context.getViewRoot().findComponent(compId); if (comp == null) { comp = context.getViewRoot().findComponent(UtilsJsf.removeRowId(compId)); } return comp; }
public static Stroke findStroke(String id) { if (id == null || id.length() == 0) { return null; } UIComponent component = FacesContext.getCurrentInstance().getViewRoot().findComponent(id); if (component instanceof UIStroke) { return ((UIStroke) component).getStroke(); } else { throw new RuntimeException(); } }
/** * Return a UIComponent instance based on the passed findComponent * expression. The viewRoot instance is used as component reference * * @param expr * @return */ @JSFFaceletFunction(name="mc:findComponent") public static UIComponent findComponent(String expr) { return FacesContext.getCurrentInstance(). getViewRoot().findComponent(expr); }
protected UIComponent findSourceComponent(final ValidationContext validationContext) { FacesContext context = validationContext.getFacesContext(); String source = context.getExternalContext().getRequestParameterMap().get("javax.faces.source"); UIComponent sourceComp = null; if (source != null) { sourceComp = context.getViewRoot().findComponent(source); } if (sourceComp == null) { sourceComp = context.getViewRoot().findComponent(UtilsJsf.removeRowId(source)); } return sourceComp; }
public void removeChildrenFromComponentTree(String clientId) { UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent(clientId); if (comp != null) { comp.getChildren().clear(); comp.getFacets().clear(); } }
/** * */ public Object convertValue(Object value) { if (value == null) { return null; } if (!(value instanceof UIComponent)) { String strVal = value.toString(); if (strVal.trim().length() == 0) { value = null; } else { // Treat String as clientId FacesContext ctx = FacesContext.getCurrentInstance(); if (!strVal.startsWith(":")) { strVal = ":" + strVal; } value = ctx.getViewRoot().findComponent(strVal); } } return value; } }
public void removeChildrenFromComponentTree(String clientId) { UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent(clientId); if (comp != null) { comp.getChildren().clear(); comp.getFacets().clear(); } }