Package org.openfaces.component.input

Examples of org.openfaces.component.input.DropDownItems


        Object dropDownFieldItems = field.getChildren().get(0);
        if (!(dropDownFieldItems instanceof DropDownItems)) {
            throw new IllegalStateException("Search component of DropDownFieldFilter should have exactly one child component - " +
                    "instance of DropDownItems component. But was  - " + dropDownFieldItems.toString());
        }
        DropDownItems dropDownItems = (DropDownItems) dropDownFieldItems;
        Collection<Object> possibleValuesCollection = filter.calculateAllCriterionNames(context);
        for (Iterator<Object> criterionIterator = possibleValuesCollection.iterator(); criterionIterator.hasNext();) {
            Object criterionObj = criterionIterator.next();
            if (isEmptyItem(criterionObj)) {
                criterionIterator.remove();
            }
        }

        List<Object> availableItems = new ArrayList<Object>(possibleValuesCollection);
        List<DropDownItem> itemList = new ArrayList<DropDownItem>(availableItems.size());
        for (Object itemObj : availableItems) {
            DropDownItem item = createDropDownItem(context, itemObj);
            itemList.add(item);
        }
        DropDownItem allRecordsItem = createDropDownItem(context, null);
        String allRecordsCriterionName = filter.getAllRecordsText();
        HtmlOutputText outputText = Components.createOutputText(context, allRecordsCriterionName);
        String predefinedCriterionClass = getPredefinedCriterionClass(context, filter);
        outputText.setStyleClass(predefinedCriterionClass);
        allRecordsItem.getChildren().add(outputText);
        itemList.add(0, allRecordsItem);
        dropDownItems.setValue(itemList);
        List<UIComponent> children = field.getChildren();
        children.clear();
        children.add(dropDownItems);
    }
View Full Code Here


        return (HtmlPanelGroup) Components.getChildBySuffix(rowContainer, PROPERTY_SELECTOR_ID_SUFFIX);
    }

    private DropDownField createPropertySelector(FacesContext context, HtmlPanelGroup propertySelectorContainer, CompositeFilter compositeFilter) {
        DropDownField propertySelector = (DropDownField) Components.createChildComponent(context, propertySelectorContainer, DropDownField.COMPONENT_TYPE, DROP_DOWN_ID_SUFFIX);
        DropDownItems dropDownItems = (DropDownItems) Components.createChildComponent(context, propertySelector, DropDownItems.COMPONENT_TYPE, DROP_DOWN_ITEMS_ID_SUFFIX);
        List<String> properties = compositeFilter.getFilterPropertiesTitles();
        dropDownItems.setValue(properties);
        propertySelector.setOnchange("O$('" + compositeFilter.getClientId(context) + "')._propertyChange(" + index + ");");
        propertySelector.setStyleClass(DEFAULT_PROPERTY_CLASS);
        propertySelector.setCustomValueAllowed(false);
        propertySelector.setSuggestionMode(SuggestionMode.ALL);
        propertySelector.setSuggestionDelay(0);
View Full Code Here

    }


    private void initOperationSelector(DropDownField operationSelector, CompositeFilter compositeFilter) {
        operationSelector.setValue(operation);
        DropDownItems dropDownItems = getOperationSelectorItems(operationSelector);
        EnumSet<FilterCondition> operations = compositeFilter.getOperations(property);
        dropDownItems.setValue(operations);
    }
View Full Code Here

        dropDown.setMaxlength(250);

        if (filterProperty.getType() == FilterType.SELECT) {
            dropDown.setCustomValueAllowed(false);
        }
        DropDownItems dropDownItems = (DropDownItems) Components.createChildComponent(context, dropDown, DropDownItems.COMPONENT_TYPE, DROP_DOWN_ITEMS_ID_SUFFIX);
        return dropDown;
    }
View Full Code Here

    private void initDropDown(DropDownField dropDown) {
        if (criterion != null) {
            dropDown.setValue(criterion.getArg1());
        }
        DropDownItems items = getDropDownItems(dropDown);
        items.setValue(filterProperty.getDataProvider());
        dropDown.setConverter(filterProperty.getConverter());

    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.input.DropDownItems

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.