Package org.openfaces.component

Examples of org.openfaces.component.FilterableComponent


    public void setParent(UIComponent parent) {
        super.setParent(parent);

        Components.runWhenReady(new SelfScheduledAction() {
            public boolean executeIfReady() {
                FilterableComponent filteredComponent = getFilteredComponent();
                if (filteredComponent == null)
                    return false;
                List<Filter> filters = filteredComponent.getFilters();
                if (!filters.contains(Filter.this))
                    filters.add(Filter.this);
                return true;
            }
        });
View Full Code Here


                throw new IllegalStateException("Couldn't find filtered component by id: " + componentId);
            return component;
        }

        public Object getPropertyValue(Object obj) {
            FilterableComponent component = getComponent();
            FacesContext context = FacesContext.getCurrentInstance();
            return component.getFilteredValueByData(context, obj, expression);
        }
View Full Code Here

    }

    private List<FilterProperty> getFilterProperties() {
        if (filterProperties == null) {
            if (getFor() != null && getAutoDetect()) {
                FilterableComponent filteredComponent = getFilteredComponent();
                if (filteredComponent instanceof AbstractTable) {
                    filterProperties = new ArrayList<FilterProperty>();
                    AbstractTable abstractTable = (AbstractTable) filteredComponent;
                    List<BaseColumn> columns = abstractTable.getAllColumns();
                    for (BaseColumn column : columns) {
View Full Code Here

    }

    public String getAllRecordsText() {
        String result = ValueBindings.get(this, "allRecordsCriterionName", allRecordsText);
        if (result == null) {
            FilterableComponent filteredComponent = getFilteredComponent();
            if (filteredComponent != null)
                result = filteredComponent.getAllRecordsFilterText();
        }
        if (result == null)
            result = DEFAULT_ALL_RECORDS_CRITERION_NAME;
        return result;
    }
View Full Code Here

    }

    public String getEmptyRecordsText() {
        String result = ValueBindings.get(this, "emptyRecordsCriterionName", emptyRecordsText);
        if (result == null) {
            FilterableComponent filteredComponent = getFilteredComponent();
            if (filteredComponent != null)
                result = filteredComponent.getEmptyRecordsFilterText();
        }
        if (result == null)
            result = DEFAULT_EMPTY_RECORDS_CRITERION_NAME;
        return result;
    }
View Full Code Here

    }

    public String getNonEmptyRecordsText() {
        String result = ValueBindings.get(this, "nonEmptyRecordsCriterionName", nonEmptyRecordsText);
        if (result == null) {
            FilterableComponent filteredComponent = getFilteredComponent();
            if (filteredComponent != null)
                result = filteredComponent.getNonEmptyRecordsFilterText();
        }
        if (result == null)
            result = DEFAULT_NON_EMPTY_RECORDS_CRITERION_NAME;
        return result;
    }
View Full Code Here

            return result;
        }
        Object expression = getExpression();

        Set<Object> criterionNamesSet = new TreeSet<Object>();
        FilterableComponent filteredComponent = getFilteredComponent();
        List originalRowList = filteredComponent.getRowListForFiltering(this);
        boolean thereAreNullValues = false;
        for (Object data : originalRowList) {
            Object value = filteredComponent.getFilteredValueByData(context, data, expression);
            if (value == null)
                thereAreNullValues = true;
            else
                criterionNamesSet.add(value);
        }
View Full Code Here

            criterion.setPropertyLocator(getPropertyLocator());
        criterion.setCaseSensitive(caseSensitive);
    }

    public PropertyLocator getPropertyLocator() {
        FilterableComponent component = getFilteredComponent();
        Object expression = getExpression();
        if (expression == null)
            throw new FacesException("Filter expression cannot be detected automatically and is not specified " +
                    "explicitly. Filter id: " + getClientId(getFacesContext()));
        if (component != null) {
View Full Code Here

    public Object getLocalValue() {
        return value;
    }

    public int getAutoFilterDelay() {
        FilterableComponent component = getFilteredComponent();
        int defaultValue = component != null ? component.getAutoFilterDelay() : Integer.MIN_VALUE;
        return ValueBindings.get(this, "autoFilterDelay", autoFilterDelay, defaultValue);
    }
View Full Code Here

    }

    protected void setDecodedCriterion(ExpressionFilter filter, ExpressionFilterCriterion newCriterion) {
        if (!filter.changeCriterion(newCriterion))
            return;
        FilterableComponent filteredComponent = filter.getFilteredComponent();
        if (filteredComponent == null) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            String filterId = filter.getClientId(facesContext);
            throw new FacesException("A filter is not associated with a component (DataTable or TreeTable): " +
                    filterId + ". It should either be placed into some table facet, or its \"for\" attribute should " +
                    "be used to explicitly attach this filter to a filtered component.");
        }
        TableUtil.markFilteringToggledInThisRequest(FacesContext.getCurrentInstance());
        filteredComponent.filterChanged(filter);
    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.FilterableComponent

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.