Package org.primefaces.component.datatable

Examples of org.primefaces.component.datatable.DataTable


    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        RowToggler toggler = (RowToggler) component;
        DataTable parentTable = toggler.getParentTable(context);
        String icon = parentTable.isExpandedRow() ? RowToggler.EXPANDED_ICON : RowToggler.COLLAPSED_ICON;

        writer.startElement("div", toggler);
        writer.writeAttribute("class", DataTable.ROW_TOGGLER_CLASS + " " + icon, null);
        writer.endElement("div");
    }
View Full Code Here


public class ColumnGroupHelperRenderer implements HelperColumnRenderer {

    public void encode(FacesContext context, Column column) throws IOException {
        ColumnGroup group = findGroup(column);
        DataTable table = (DataTable) group.getParent();
        String type = group.getType();
        DataTableRenderer renderer = (DataTableRenderer) context.getRenderKit().getRenderer("org.primefaces.component", "org.primefaces.component.DataTableRenderer");
       
        if(type.equals("header"))
            renderer.encodeColumnHeader(context, table, column);
View Full Code Here

    public void setColumn(UIColumn column) {
        this.column = column;
    }
   
    private Object resolveValue() {
        DataTable data = (DataTable) source;
        data.setRowModel(rowIndex);
        Object value = null;
       
        for(UIComponent child : column.getChildren()) {
            if(child instanceof CellEditor) {
                UIComponent inputFacet = child.getFacet("input");
View Full Code Here

           
      if(!(component instanceof DataTable)) {
        throw new FacesException("Unsupported datasource target:\"" + component.getClass().getName() + "\", exporter must target a PrimeFaces DataTable.");
            }
           
      DataTable table = (DataTable) component;
      exporter.export(context, table, outputFileName, isPageOnly, isSelectionOnly, encodingType, preProcessor, postProcessor);
     
      context.responseComplete();
    }
        catch (IOException e) {
View Full Code Here

      if(target == null)
        throw new FacesException("Cannot find component \"" + tableId + "\" in view.");
      if(!(target instanceof DataTable))
        throw new FacesException("Unsupported datasource target:\"" + target.getClass().getName() + "\", exporter must target a PrimeFaces DataTable.");
     
      DataTable table = (DataTable) target;
      exporter.export(facesContext, table, outputFileName, isPageOnly, excludedColumnIndexes, encodingType, preProcessor, postProcessor);
     
      facesContext.responseComplete();
    } catch (IOException e) {
      throw new FacesException(e);
View Full Code Here

        JsfUtil.addErrorMessage(err_msg);
    }

    private void addLazyTablePanel (Application app)
    {
        DataTable table = (DataTable) app.createComponent(DataTable.COMPONENT_TYPE);
        String tableId = table.getClientId();

        /*
         * Set variable name for generated table it constant
         */
        table.setVar(TABLE_VAR);
        table.setLazy(true);
        table.setPaginator(true);
        table.setPaginatorAlwaysVisible(false);
        table.setStyle("width: 100%");

        table.setSelectionMode("single");
        table.setValueExpression("selection",
                JsfUtil.getExpression(String.format (SELECTED_OBJECT, BEAN_NAME, CAR_SEL_OBJECT)));

        table.setValueExpression("paginatorTemplate", JsfUtil.getExpression(PAGINATOR_TEMPLATE));

        table.setValueExpression("rows", JsfUtil.getExpression(String.format(PAGE_ZIZE, BEAN_NAME)));
        table.setValueExpression(JsfUtil.VALUE_NAME, JsfUtil.getExpression("#{" + BEAN_NAME + "." + LAZY_TABLE_MODEL + "}"));

        /*
         * Row select and unselect listeners is needed for properly work of selection events.
         * By default these are empty functions
         */
        table.setRowSelectListener(
                JsfUtil.getMethodExpression (
                    String.format (ON_ROW_SELECT, BEAN_NAME),
                    null,
                    SelectEvent.class));
        /*
         * Unselect listener
         */
        table.setRowUnselectListener(JsfUtil.getMethodExpression (
                    String.format (ON_ROW_UNSELECT, BEAN_NAME),
                    null,
                    UnselectEvent.class));

        JsfUtil.addTableColumns("cars", table);
View Full Code Here

        carsLazyPanel.getChildren().add(table);
    }
   
    private void addTablePanel (Application app)
    {
        DataTable table = (DataTable) app.createComponent(DataTable.COMPONENT_TYPE);
        String tableId = table.getClientId();

        /*
         * Set variable name for generated table it constant
         */
        table.setVar(TABLE_VAR);
        table.setLazy(false);
        table.setPaginator(true);
        table.setPaginatorAlwaysVisible(true);
        table.setStyle("width: 100%");

        table.setSelectionMode("single");
        table.setValueExpression("selection",
                JsfUtil.getExpression(String.format (SELECTED_OBJECT, BEAN_NAME, CAR_SEL_OBJECT)));

        table.setValueExpression("paginatorTemplate", JsfUtil.getExpression(PAGINATOR_TEMPLATE));

        table.setValueExpression("rows", JsfUtil.getExpression(String.format(PAGE_ZIZE, BEAN_NAME)));
        table.setValueExpression(JsfUtil.VALUE_NAME, JsfUtil.getExpression("#{" + BEAN_NAME + "." + TABLE_MODEL + "}"));

        /*
         * Row select and unselect listeners is needed for properly work of selection events.
         * By default these are empty functions
         */
        table.setRowSelectListener(
                JsfUtil.getMethodExpression (
                    String.format (ON_ROW_SELECT, BEAN_NAME),
                    null,
                    SelectEvent.class));
        /*
         * Unselect listener
         */
        table.setRowUnselectListener(JsfUtil.getMethodExpression (
                    String.format (ON_ROW_UNSELECT, BEAN_NAME),
                    null,
                    UnselectEvent.class));

        JsfUtil.addTableColumns("cars", table);
View Full Code Here

      if(target == null)
        throw new FacesException("Cannot find component \"" + tableId + "\" in view.");
      if(!(target instanceof DataTable))
        throw new FacesException("Unsupported datasource target:\"" + target.getClass().getName() + "\", exporter must target a PrimeFaces DataTable.");
     
      DataTable table = (DataTable) target;
      exporter.export(facesContext, table, outputFileName, isPageOnly, excludedColumnIndexes, encodingType, preProcessor, postProcessor);
     
      facesContext.responseComplete();
    } catch (IOException e) {
      throw new FacesException(e);
View Full Code Here

TOP

Related Classes of org.primefaces.component.datatable.DataTable

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.