Ejemplo n.º 1
0
  /** @param hierarchyName */
  protected void setHierarchyName(String hierarchyName) {
    FacesContext context = FacesContext.getCurrentInstance();
    UIViewRoot view = context.getViewRoot();

    if (hierarchyName == null) {
      view.getAttributes().remove("hierarchy");
    } else {
      view.getAttributes().put("hierarchy", hierarchyName);
    }

    this.filterMembers = null;
    this.filterNode = null;
    this.selection = null;
  }
  public static UIViewRoot findRoot(FacesContext context, ServletRequest req, Object etag)
      throws Exception {
    if (context == null) context = FacesContext.getCurrentInstance();

    UIViewRoot root = context.getViewRoot();

    if (root == null)
      throw new NullPointerException(L.l("f:view can't find current in FacesContext"));

    Object oldETag = root.getAttributes().get("caucho.etag");

    if (oldETag != null && !oldETag.equals(etag)) {
      // clear view on JSP change

      root.getChildren().clear();
      root.getFacets().clear();
    }

    root.getAttributes().put("caucho.etag", etag);

    return root;
  }
Ejemplo n.º 3
0
  /** @return the filteredHierarchy */
  protected String getHierarchyName() {
    FacesContext context = FacesContext.getCurrentInstance();
    UIViewRoot view = context.getViewRoot();

    return (String) view.getAttributes().get("hierarchy");
  }