Package org.richfaces.component

Examples of org.richfaces.component.UIDataTableBase


    @Override
    public void encodeTableBodyStart(ResponseWriter writer, FacesContext facesContext, UIDataTableBase dataTableBase)
        throws IOException {
        AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable) dataTableBase;

        UIDataTableBase parent = findParent(subTable);
        if (parent instanceof AbstractDataTable) {
            writer.startElement(HtmlConstants.TBODY_ELEMENT, null);
            writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE,
                parent.getRelativeClientId(facesContext) + ":" + subTable.getId() + TB_ROW, null);
            writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableSkinClass(), null);

            String predefinedStyles = !subTable.isExpanded() ? DISPLAY_NONE : null;
            encodeStyle(writer, facesContext, subTable, predefinedStyles);
        }
View Full Code Here


        encodeFooterFacet(writer, facesContext, subTable, false);
    }

    @Override
    public boolean encodeParentTBody(UIDataTableBase dataTableBase) {
        UIDataTableBase parent = findParent((AbstractCollapsibleSubTable) dataTableBase);
        return (parent instanceof AbstractDataTable);
    }
View Full Code Here

        throws IOException {
        AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable) component;

        if (AbstractCollapsibleSubTable.BODY.equals(metaComponentId)) {
            ResponseWriter writer = facesContext.getResponseWriter();
            UIDataTableBase dataTableBase = findParent(subTable);

            String updateId = dataTableBase.getRelativeClientId(facesContext) + ":" + subTable.getId() + TB_ROW;

            partialStart(facesContext, updateId);
            encodeTableRows(writer, facesContext, subTable, false);
            partialEnd(facesContext);
        }
View Full Code Here

        }
        return true;
    }

    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        UIDataTableBase dataTable = (UIDataTableBase) component;
        encodeTableStart(writer, context, dataTable);
        encodeTableFacets(writer, context, dataTable);
    }
View Full Code Here

    private static final String SEPARATOR = ":";

    protected void decodeSortingFiltering(FacesContext context, UIComponent component) {
        if (component instanceof UIDataTableBase) {

            UIDataTableBase dataTableBase = (UIDataTableBase) component;
            Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
            String clientId = dataTableBase.getClientId(context);

            String filtering = requestMap.get(clientId + FILTERING_STRING);
            if (filtering != null && filtering.trim().length() > 0) {
                decodeFiltering(context, dataTableBase, filtering);
            }
View Full Code Here

    @Override
    public void encodeTableBodyStart(ResponseWriter writer, FacesContext facesContext, UIDataTableBase dataTableBase)
        throws IOException {
        AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable) dataTableBase;

        UIDataTableBase component = findParent(subTable);
        if (component instanceof AbstractDataTable) {
            writer.startElement(HtmlConstants.TBODY_ELEMENT, null);
            writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE,
                component.getRelativeClientId(facesContext) + ":" + subTable.getId() + TB_ROW, null);
            writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, getTableSkinClass(), null);

            String predefinedStyles = !subTable.isExpanded() ? DISPLAY_NONE : null;
            encodeStyle(writer, facesContext, subTable, predefinedStyles);
        }
View Full Code Here

        encodeFooterFacet(writer, facesContext, subTable, false);
    }

    @Override
    public boolean encodeParentTBody(UIDataTableBase dataTableBase) {
        UIDataTableBase parent = findParent((AbstractCollapsibleSubTable) dataTableBase);
        return (parent instanceof AbstractDataTable);
    }
View Full Code Here

        throws IOException {
        AbstractCollapsibleSubTable subTable = (AbstractCollapsibleSubTable) component;

        if (AbstractCollapsibleSubTable.BODY.equals(metaComponentId)) {
            ResponseWriter writer = facesContext.getResponseWriter();
            UIDataTableBase dataTableBase = findParent(subTable);

            String updateId = dataTableBase.getRelativeClientId(facesContext) + ":" + subTable.getId() + TB_ROW;

            partialStart(facesContext, updateId);
            encodeTableRows(writer, facesContext, subTable, false);
            partialEnd(facesContext);
        }
View Full Code Here

        writer.startElement(HtmlConstants.INPUT_ELEM, component);
        // TODO nick - selection input id should use constants/be a method
        writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context) + ":si", null);
        writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, component.getClientId(context) + ":si", null);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN, null);
        UIDataTableBase table = (UIDataTableBase) component;
        StringBuilder builder = new StringBuilder("|");
        Object key = table.getRowKey();
        table.captureOrigValue(context);
        SequenceRange range = (SequenceRange) table.getComponentState().getRange();
        int first = range.getFirstRow();
        int last = first + range.getRows() - 1;
        Map<String, Object> attributes = component.getAttributes();
        table.setRowKey(attributes.get("activeRowKey"));
        int activeIndex = table.getRowIndex();
        if (activeIndex > 0) {
            if (activeIndex < first) {
                builder.append(ClientSelection.FLAG_BEFORE_RANGE);
            } else if (activeIndex > last) {
                builder.append(ClientSelection.FLAG_AFTER_RANGE);
            }
        }
        builder.append("|");
        table.setRowKey(attributes.get("shiftRowKey"));
        int shiftIndex = table.getRowIndex();
        if (shiftIndex > 0) {
            if (shiftIndex < first) {
                builder.append(ClientSelection.FLAG_BEFORE_RANGE);
            } else if (shiftIndex > last) {
                builder.append(ClientSelection.FLAG_AFTER_RANGE);
            }
        }
        builder.append("|");
        table.setRowKey(context, key);
        table.restoreOrigValue(context);
        writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, builder.toString(), null);
        writer.endElement(HtmlConstants.INPUT_ELEM);
    }
View Full Code Here

    private static final String SEPARATOR = ":";

    protected void decodeSortingFiltering(FacesContext context, UIComponent component) {
        if (component instanceof UIDataTableBase) {

            UIDataTableBase dataTableBase = (UIDataTableBase) component;
            Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
            String clientId = dataTableBase.getClientId(context);

            String filtering = requestMap.get(clientId + FILTERING_STRING);
            if (filtering != null && filtering.trim().length() > 0) {
                decodeFiltering(context, dataTableBase, filtering);
            }
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIDataTableBase

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.