Package org.zkoss.zul

Examples of org.zkoss.zul.Datebox


            }
        };
    }

    private void validateEndDate(Component comp, Object value) {
        Datebox startDateBox = (Datebox) comp.getPreviousSibling();
        if (startDateBox != null) {
            if (startDateBox.getValue() != null) {
                if (startDateBox.getValue().compareTo((Date) value) > 0) {
                    throw new WrongValueException(
                            comp,
                            _("End date is not valid, the new end date must be after start date"));
                }
            }
View Full Code Here


        this.dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locales
                .getCurrent());
    }

    public Datebox createDateBox() {
        dateBox = new Datebox();
        dateBox.setFormat("short");
        dateBox.setValue(getter.get());
        registerOnEnterOpenDateBox(dateBox);
        registerBlurListener(dateBox);
        registerOnChange(dateBox);
View Full Code Here

         if(listingCriterions != null){
            Rows rows = listingCriterions.getRows();
            List<Row> listRows = rows.getChildren();
            for(Row row : listRows){
                //Validate endDate Domain Restricctions.
                Datebox endDate = getEndDatebox(row);
                if(isInvalid(endDate)){
                    validateEndDate(endDate, endDate.getValue());
                }
                //Validate startDate Domain Restricctions.
                Datebox startDate = getStartDatebox(row);
                if(isInvalid(startDate)){
                    validateStartDate(startDate, startDate.getValue());
                }
                //Validate endDate Domain Restricctions.
                Bandbox bandCriterion = getBandType(row);
                if(isInvalid(bandCriterion)){
                    CriterionSatisfactionDTO satisfactionDTO =
View Full Code Here

            if (row != null) {
                String propertyName = invalidValue.getPropertyPath();

                if (CriterionSatisfactionDTO.START_DATE.equals(propertyName)) {
                    // Locate TextboxResource
                    Datebox startDate = getStartDatebox(row);
                    // Value is incorrect, clear
                    startDate.setValue(null);
                    throw new WrongValueException(startDate,
                            _("cannot be empty"));
                }
                if (CriterionSatisfactionDTO.CRITERION_WITH_ITS_TYPE.equals(propertyName)) {
                    // Locate TextboxResource
View Full Code Here

        labelName.setParent(row);
        labelName.setValue(label);
    }

    private void appendDate(final Row row) {
        Datebox date = new Datebox();
        date.setParent(row);

        final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
        final TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();

        Util.bind(date, new Util.Getter<Date>() {
            @Override
            public Date get() {
                return item.getDate();
            }
        }, new Util.Setter<Date>() {

            @Override
            public void set(Date value) {
                item.setDate(value);
                updateAdvancesIfNeeded();
            }
        });

        date.setDisabled(assignedTaskQualityFormsToOrderElementModel
                .isDisabledDateItem(taskQualityForm, item));
        date.setConstraint(checkConsecutiveDate(row));
    }
View Full Code Here

                Row rowItem = findRowOfTaskQualityFormItem(row, itemName);

                if (rowItem != null) {
                    if (TaskQualityFormItem.propertyDate.equals(propertyName)) {
                        openDetails(rowItem);
                        Datebox datebox = getDatebox(rowItem);
                        throw new WrongValueException(datebox,
                                _(invalidValue.getMessage()));
                    }
                    if (TaskQualityFormItem.propertyPassed.equals(propertyName)) {
                        openDetails(rowItem);
View Full Code Here

        if (listingCriterions != null) {
            Rows rows = listingCriterions.getRows();
            List<Row> listRows = rows.getChildren();
            for (Row row : listRows) {
                // Validate endDate Domain Restricctions.
                Datebox endDate = getEndDatebox(row);
                if (isInvalid(endDate)) {
                    validateEndDate(endDate, endDate.getValue());
                }
                // Validate startDate Domain Restricctions.
                Datebox startDate = getStartDatebox(row);
                if (isInvalid(startDate)) {
                    validateStartDate(startDate, startDate.getValue());
                }
                // Validate endDate Domain Restricctions.
                Bandbox bandCriterion = getBandType(row);
                if (isInvalid(bandCriterion)) {
                    CriterionSatisfactionDTO satisfactionDTO = (CriterionSatisfactionDTO) row
View Full Code Here

            if (row != null) {
                String propertyName = invalidValue.getPropertyPath();

                if (CriterionSatisfactionDTO.START_DATE.equals(propertyName)) {
                    // Locate TextboxResource
                    Datebox startDate = getStartDatebox(row);
                    // Value is incorrect, clear
                    startDate.setValue(null);
                    throw new WrongValueException(startDate,
                            _("cannot be empty"));
                }
                if (CriterionSatisfactionDTO.CRITERION_WITH_ITS_TYPE
                        .equals(propertyName)) {
View Full Code Here

     * Append a Datebox "init date" to row
     *
     * @param row
     */
    private void appendDateboxInitDate(final Row row) {
        Datebox initDateBox = new Datebox();
        bindDateboxInitDate(initDateBox, (ResourcesCostCategoryAssignment) row.getValue());
        initDateBox.setConstraint("no empty:" + _("Start date cannot be empty"));
        row.appendChild(initDateBox);

        initDateBox.addEventListener("onChange", new EventListener() {

            @Override
            public void onEvent(Event event) {
                // Updates the constraint of the endDate box with the new date
                LocalDate initDate = ((ResourcesCostCategoryAssignment)row.getValue()).getInitDate();
                Datebox endDateBox = (Datebox) row.getChildren().get(2);
                endDateBox.setConstraint("after " +
                        String.format("%04d", initDate.getYear()) +
                        String.format("%02d", initDate.getMonthOfYear()) +
                        String.format("%02d", initDate.getDayOfMonth()));
            }
        });
View Full Code Here

     * Append a Datebox "end date" to row
     *
     * @param row
     */
    private void appendDateboxEndDate(Row row) {
        Datebox endDateBox = new Datebox();
        bindDateboxEndDate(endDateBox, (ResourcesCostCategoryAssignment) row.getValue());
        LocalDate initDate = ((ResourcesCostCategoryAssignment)row.getValue()).getInitDate();
        if (initDate != null) {
            endDateBox.setConstraint("after " +
                    String.format("%04d", initDate.getYear()) +
                    String.format("%02d", initDate.getMonthOfYear()) +
                    String.format("%02d", initDate.getDayOfMonth()));
        }
        row.appendChild(endDateBox);
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Datebox

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.