Package org.primefaces.component.column

Examples of org.primefaces.component.column.Column


   
    writer.write("var " + columnDefVar + " = [");
       
    for(UIComponent kid : dataTable.getChildren()) {
      if(kid.isRendered() && kid instanceof Column) {
        Column column = (Column) kid;
       
        if(firstWritten)
          writer.write(",");
        else
          firstWritten=true;
       
        writer.write("{key:'" + column.getClientId(facesContext+ "'");
       
        //header
        UIComponent header = column.getFacet("header");
        writer.write(",label:'");
        if(header != null) {
          if(ComponentUtils.isLiteralText(header)) {
            String literalText = header.toString().trim();
            ValueExpression ve = facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), literalText, Object.class);
            Object value = ve.getValue(facesContext.getELContext());
            if(value != null) {
              writer.write(value.toString());
            }
          } else {           
            renderChild(facesContext, column.getFacet("header"));
          }
         
          if(column.getValueExpression("filterBy") != null) {
            encodeColumnFilter(facesContext, column, datatableVar);
          }
        }
        writer.write("'");
       
        if(column.isResizable()) writer.write(",resizeable:true");
        if(column.getWidth() != Integer.MIN_VALUE) writer.write(",width:" + column.getWidth());
        if(column.getStyleClass() != null) writer.write(",className:'" + column.getStyleClass() + "'");
       
        //sorting
        if(column.getValueExpression("sortBy") != null) {
          writer.write(",sortable:true");
         
          if(!dataTable.isDynamic()) {
            writer.write(",sortOptions:{field:'" + column.getClientId(facesContext) + "'");
            if(column.getSortFunction() != null) {
              writer.write(",sortFunction:" + column.getSortFunction().getExpressionString());
            }
            writer.write("}");
           
            if(column.getParser() != null) writer.write(",parser:'" + column.getParser() + "'");
          }
        }
       
        writer.write("}");
      }
View Full Code Here


     
      for(Iterator<UIComponent> iterator = dataTable.getChildren().iterator(); iterator.hasNext();) {
        UIComponent kid = iterator.next();
       
        if(kid.isRendered() && kid instanceof Column) {
          Column column = (Column) kid;
         
          writer.startElement("td", null);
          renderChildren(facesContext, column);
          writer.endElement("td");
        }
View Full Code Here

     
      for(Iterator<UIComponent> children = getChildren().iterator(); children.hasNext();) {
        UIComponent kid = children.next();
         
        if(kid.isRendered() && kid instanceof Column) {
          Column column = (Column) kid;
         
          if(column.getValueExpression("filterBy") != null) {
            filterMap.put(column.getClientId(FacesContext.getCurrentInstance()), column.getValueExpression("filterBy"));
          }
        }
      }
    }
View Full Code Here

    writer.startElement("tr", null);
    for(Iterator<UIComponent> iterator = treeTable.getChildren().iterator(); iterator.hasNext();) {
      UIComponent kid = iterator.next();
     
      if(kid.isRendered() && kid instanceof Column) {
        Column column = (Column) kid;
        String columnStyleClass = column.getStyleClass() == null ? "ui-state-default" : "ui-state-default " + column.getStyleClass();

        writer.startElement("th", null);
        writer.writeAttribute("class", columnStyleClass, null);
         
        writer.startElement("div", null);
        writer.writeAttribute("class", TreeTable.HEADER_CLASS, null);
       
        writer.startElement("span", null);
        writer.writeAttribute("class", TreeTable.HEADER_LABEL_CLASS, null);
       
        UIComponent header = column.getFacet("header");
        if(header != null) {
          if(ComponentUtils.isLiteralText(header))
            writer.write(header.toString());
          else
            header.encodeAll(facesContext);
View Full Code Here

   
    for(Iterator<UIComponent> iterator = treeTable.getChildren().iterator(); iterator.hasNext();) {
      UIComponent kid = iterator.next();
     
      if(kid.isRendered() && kid instanceof Column) {
        Column column = (Column) kid;

        writer.startElement("td", null);
        if(column.getStyleClass() != null)
          writer.writeAttribute("class", column.getStyleClass(), null);
       
        column.encodeAll(facesContext);
       
        writer.endElement("td");
      }
    }
   
View Full Code Here

     
      writer.startElement("tr", null);
     
      for(UIComponent child : sheet.getChildren()) {
        if(child.isRendered() && (child instanceof Column)) {
          Column column = (Column) child;
         
          writer.startElement("td", null);
          if(datasource) {
            writer.write(ComponentUtils.getStringValueToRender(facesContext, column.getChildren().get(0)));
          } else {
            renderChildren(facesContext, column);
          }
          writer.endElement("td");
        }
View Full Code Here

                Row headerRow = (Row) child;

                if(headerRow.isRendered()) {
                    for(UIComponent headerRowChild : headerRow.getChildren()) {
                        if(headerRowChild instanceof Column) {
                            Column column = (Column) headerRowChild;
                            if(column.isRendered()) {
                                ValueExpression columnFilterByVE = column.getValueExpression("filterBy");
                           
                                if(columnFilterByVE != null) {
                                    ValueExpression filterByVE = columnFilterByVE;
                                    UIComponent filterFacet = column.getFacet("filter");
                                    Object filterValue;

                                    if(filterFacet == null)
                                        filterValue = params.get(column.getClientId(context) + separator + "filter");
                                    else
                                        filterValue = ((ValueHolder) filterFacet).getLocalValue();

                                    filterMetadata.add(new FilterMeta(column, filterByVE, filterValue));
                                }
                            }
                        }
                        else if(headerRowChild instanceof Columns) {
                            Columns uiColumns = (Columns) headerRowChild;
                            String uiColumnsClientId = uiColumns.getClientId(context);

                            for(int i=0; i < uiColumns.getRowCount(); i++) {
                                DynamicColumn dynaColumn = new DynamicColumn(i, uiColumns);
                                dynaColumn.setColumnKey(uiColumnsClientId + separator + i);
                                dynaColumn.applyStatelessModel();
                               
                                ValueExpression columnFilterByVE = dynaColumn.getValueExpression("filterBy");
                                if(columnFilterByVE != null) {
                                    Object filterValue = null;
                                    String filterId = dynaColumn.getContainerClientId(context) + separator + "filter";
                                    UIComponent filterFacet = dynaColumn.getFacet("filter");
                                   
                                    if(filterFacet == null)
                                        filterValue = params.get(filterId);
                                    else
                                        filterValue = ((ValueHolder) filterFacet).getLocalValue();
                                   
                                    filterMetadata.add(new FilterMeta(dynaColumn, columnFilterByVE, filterValue));
                                }
                            }
                        }
                    }
                }
            }
        }
        else {
            for(UIColumn column : table.getColumns()) {
                ValueExpression columnFilterByVE = column.getValueExpression("filterBy");
               
                if (columnFilterByVE != null) {
                    UIComponent filterFacet = column.getFacet("filter");                   
                    ValueExpression filterByVE = columnFilterByVE;
                    Object filterValue = null;
                    String filterId = null;
                   
                    if(column instanceof Column) {
                        filterId = column.getClientId(context) + separator + "filter";
                    }
                    else if(column instanceof DynamicColumn) {
                        DynamicColumn dynamicColumn = (DynamicColumn) column;
                        dynamicColumn.applyStatelessModel();
                        filterId = dynamicColumn.getContainerClientId(context) + separator + "filter";
View Full Code Here

        writer.startElement("tr", null);
        writer.writeAttribute("class", DataTable.SUMMARY_ROW_CLASS, null);

        for(UIComponent kid : row.getChildren()) {
            if(kid.isRendered() && kid instanceof Column) {
                Column column = (Column) kid;
                String style = column.getStyle();
                String styleClass = column.getStyleClass();
       
                writer.startElement("td", null);
                if(style != null) writer.writeAttribute("style", style, null);
                if(styleClass != null) writer.writeAttribute("class", styleClass, null);
                if(column.getRowspan() != 1) writer.writeAttribute("rowspan", column.getRowspan(), null);
                if(column.getColspan() != 1) writer.writeAttribute("colspan", column.getColspan(), null);

                column.encodeAll(context);

                writer.endElement("td");
            }
        }
View Full Code Here

                writer.startElement("tbody", null);
                writer.startElement("tr", null);
                       
                 for(UIComponent kid : old.getChildren()) {
                     if(kid instanceof Column && kid.isRendered()) {
                         Column column = (Column) kid;
                        
                         writer.startElement("td", null);
                         if(column.getStyle() != null) writer.writeAttribute("style", column.getStyle(), null);
                         if(column.getStyleClass() != null) writer.writeAttribute("class", column.getStyleClass(), null);
                        
                         renderChildren(context, column);
                         writer.endElement("td");
                     }
                 }
View Full Code Here

        writer.writeAttribute("class", rowClass, null);
        writer.writeAttribute("role", "row", null);
       
        for(UIComponent child : row.getChildren()) {
            if(child instanceof Column && child.isRendered()) {
                Column column = (Column) child;
                String userStyleClass = column.getStyleClass();
                String styleClass = (userStyleClass == null) ? columnClass : columnClass + " " + userStyleClass;
                               
                writer.startElement("td", null);
                if(shouldWriteId(column)) {
                    writer.writeAttribute("id", column.getClientId(context), null);
                }
                writer.writeAttribute("role", columnRole, null);
                writer.writeAttribute("class", styleClass, null);
               
                if(column.getStyle() != null) writer.writeAttribute("style", column.getStyle(), null);
                if(column.getColspan() > 1) writer.writeAttribute("colspan", column.getColspan(), null);
                if(column.getRowspan() > 1) writer.writeAttribute("rowspan", column.getRowspan(), null);
               
                renderChildren(context, column);
               
                writer.endElement("td");
            }
View Full Code Here

TOP

Related Classes of org.primefaces.component.column.Column

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.