Package org.xulfaces.component.grid

Examples of org.xulfaces.component.grid.GridComponent


        return "xul.renderer.Grid";
    }
   
    protected void setProperties(UIComponent component) {
        super.setProperties(component);
        GridComponent gridComponent = (GridComponent) component;
        gridComponent.setVar(getVar());
        ValueBinding valueBinding = component.getValueBinding("value");
    if(valueBinding != null){           
      gridComponent.setValue(valueBinding.getValue(getFacesContext()));
    }
    }
View Full Code Here


    responseWriter.endElement("grid");
  }

  public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {

    GridComponent gridComponent = (GridComponent) component;
    ResponseWriter responseWriter = facesContext.getResponseWriter();

    responseWriter.startElement("columns", component);
    List<UIComponent> children = gridComponent.getChildren();
    for (UIComponent kid : children) {     
      renderChild(facesContext, kid);
    }
    responseWriter.endElement("columns");

    Object value = gridComponent.getValue();
    if (value != null) {
      responseWriter.startElement("rows", component);
      String rowsId = gridComponent.getClientId(facesContext)+"_rows";
      responseWriter.writeAttribute("id",rowsId,"id");
            
      if (value instanceof Collection) {
       
        int first = gridComponent.getFirst();
        int rows = gridComponent.getRows();
        int rowCount = gridComponent.getRowCount();
       
        if (rows <= 0) {
          rows = rowCount - first;
        }
       
        int last = first + rows;
       
        if (last > rowCount)   last = rowCount;

        for (int i = first; i < last; i++) {
          gridComponent.setRowIndex(i);
          if (!gridComponent.isRowAvailable()) {
            return;
          }
          Object object = gridComponent.getRowData();
          responseWriter.startElement("row", component);
          encodeRow(facesContext, gridComponent, object);
          responseWriter.endElement("row");
        }
      }
View Full Code Here

TOP

Related Classes of org.xulfaces.component.grid.GridComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.