Examples of AutoComplete


Examples of org.libreplan.web.common.components.Autocomplete

        return comboLabelTypes;
    }

    private Autocomplete createComboboxLabels(LabelType labelType,
            WorkReportLabelTypeAssigment workReportLabelTypeAssigment) {
        Autocomplete comboLabels = new Autocomplete();
        comboLabels.setButtonVisible(true);

        if (labelType != null) {
            final List<Label> listLabel = this.getMapLabelTypes()
                    .get(labelType);
            for (Label label : listLabel) {
                Comboitem comboItem = new Comboitem();
                comboItem.setValue(label);
                comboItem.setLabel(label.getName());
                comboItem.setParent(comboLabels);

                if ((workReportLabelTypeAssigment.getDefaultLabel() != null)
                        && (workReportLabelTypeAssigment.getDefaultLabel()
                                .equals(label))) {
                    comboLabels.setSelectedItem(comboItem);
                }
            }
        }
        return comboLabels;
    }
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

     * Append a Autocomplete @{link CostCategory} to row
     *
     * @param row
     */
    private void appendAutocompleteType(final Row row) {
        final Autocomplete autocomplete = new Autocomplete();
        autocomplete.setAutodrop(true);
        autocomplete.applyProperties();
        autocomplete.setFinder("CostCategoryFinder");
        autocomplete.setConstraint("no empty:" + _("A category must be selected"));

        // Getter, show type selected
        if (getCostCategory(row) != null) {
            autocomplete.setSelectedItem(getCostCategory(row));
        }

        // Setter, set type selected to HourCost.type
        autocomplete.addEventListener("onSelect", new EventListener() {

            @Override
            public void onEvent(Event event) {
                final Comboitem comboitem = autocomplete.getSelectedItem();

                if(comboitem != null) {
                    // Update resourcesCostCategoryAssignment
                    ResourcesCostCategoryAssignment assignment =
                        (ResourcesCostCategoryAssignment) row.getValue();
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

    private void appendAutocompleteLabelsByTypeInLine(Row row,
            final Label currentLabel) {
        final LabelType labelType = currentLabel.getType();
        final WorkReportLine line = (WorkReportLine) row.getValue();
        final Autocomplete comboLabels = createAutocompleteLabels(labelType,
                currentLabel);
        comboLabels.setParent(row);

        comboLabels.addEventListener(Events.ON_CHANGE, new EventListener() {
            @Override
            public void onEvent(Event event) {
                if (comboLabels.getSelectedItem() != null) {
                    Label newLabel = (Label) comboLabels.getSelectedItem()
                            .getValue();
                    workReportModel.changeLabelInWorkReportLine(currentLabel,
                            newLabel, line);
                }
                reloadWorkReportLines();
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

    }

    private void appendAutocompleteLabelsByType(Row row,
            final Label currentLabel) {
        final LabelType labelType = currentLabel.getType();
        final Autocomplete comboLabels = createAutocompleteLabels(labelType,
                currentLabel);
        comboLabels.setParent(row);

        comboLabels.addEventListener(Events.ON_CHANGE, new EventListener() {
            @Override
            public void onEvent(Event event) {
                if(comboLabels.getSelectedItem() != null){
                    Label newLabel = (Label) comboLabels.getSelectedItem()
                            .getValue();
                    workReportModel.changeLabelInWorkReport(currentLabel,
                            newLabel);
                }
                Util.reloadBindings(headingFieldsAndLabels);
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

            }
        });
    }

    private Autocomplete createAutocompleteLabels(LabelType labelType,Label selectedLabel) {
        Autocomplete comboLabels = new Autocomplete();
        comboLabels.setButtonVisible(true);
        comboLabels.setWidth("100px");

        if (labelType != null) {
            final List<Label> listLabel = getMapLabelTypes()
                    .get(labelType);

            for (Label label : listLabel) {
                Comboitem comboItem = new Comboitem();
                comboItem.setValue(label);
                comboItem.setLabel(label.getName());
                comboItem.setParent(comboLabels);

                if ((selectedLabel != null)
                        && (selectedLabel.equals(label))) {
                    comboLabels.setSelectedItem(comboItem);
                }
            }
        }
        return comboLabels;
    }
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

        if (getWorkReportType().getResourceIsSharedInLines()) {
            if (!validateWorkReport()) {
                return false;
            }
        } else if (workReportLine.getResource() == null) {
            Autocomplete autoResource = getTextboxResource(row);
            if (autoResource != null) {
                String message = _("cannot be empty");
                showInvalidMessage(autoResource, message);
            }
            return false;
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

        return ((CriterionDTO) listitem.getValue()).getCriterion()
                .getCostCategory();
    }

    private Autocomplete appendAutocompleteType(final Treeitem row) {
        final Autocomplete autocomplete = new Autocomplete();
        autocomplete.setAutodrop(true);
        autocomplete.applyProperties();
        autocomplete.setFinder("CostCategoryFinder");

        // Getter, show type selected
        if (getCostCategory(row) != null) {
            autocomplete.setSelectedItem(getCostCategory(row));
        }

        // Setter, set type selected to HourCost.type
        autocomplete.addEventListener("onSelect", new EventListener() {

            @Override
            public void onEvent(Event event) {
                final Comboitem comboitem = autocomplete.getSelectedItem();

                if (comboitem != null) {
                    // Update resourcesCostCategoryAssignment
                    CriterionDTO assignment = (CriterionDTO) row
                            .getValue();
                    assignment.getCriterion().setCostCategory(
                            (CostCategory) comboitem
                            .getValue());
                    row.setValue(assignment);
                }
            }
        });

        autocomplete.addEventListener("onBlur", new EventListener() {

            @Override
            public void onEvent(Event event) {
                if (autocomplete.getText().isEmpty()) {
                    autocomplete.clear();
                    CriterionDTO assignment = (CriterionDTO) row.getValue();
                    assignment.getCriterion().setCostCategory(null);
                }
            }
        });
View Full Code Here

Examples of org.libreplan.web.common.components.Autocomplete

     * Append a Autocomplete @{link Resource} to row
     *
     * @param row
     */
    private void appendResourceInLines(final Row row) {
        final Autocomplete autocomplete = new Autocomplete();
        autocomplete.setWidth("200px");
        autocomplete.setAutodrop(true);
        autocomplete.applyProperties();
        autocomplete.setFinder("ResourceFinder");

        // Getter, show worker selected
        if (getResource(row) != null) {
            autocomplete.setSelectedItem(getResource(row));
        }

        autocomplete.addEventListener("onChange", new EventListener() {
            @Override
            public void onEvent(Event event) {
                changeResourceInLines(autocomplete, row);
            }
        });
View Full Code Here

Examples of org.primefaces.component.autocomplete.AutoComplete

        if(s.trim().equals("")){
            return null;
        }
        else{
            DAOCourse t = DAOCourse.getInstance();
            AutoComplete autoComplete = (AutoComplete) uiComponent;

            return t.get(new ObjectId((String)autoComplete.getSubmittedValue()));

        }
    }
View Full Code Here

Examples of org.primefaces.component.autocomplete.AutoComplete

        if(s.trim().equals("")){
            return null;
        }
        else{
            DAOStudent t = DAOStudent.getInstance();
            AutoComplete autoComplete = (AutoComplete) uiComponent;

            Student student = t.get(new ObjectId((String)autoComplete.getSubmittedValue()));
            return student;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.