Package org.zkoss.zul

Examples of org.zkoss.zul.Timebox


    public void objToView(Object obj) {
        RequestMaintainForm form = (RequestMaintainForm) obj;

        Textbox requestByTB = (Textbox) getFellow("requestBy");
        Datebox requestAtDate = (Datebox) getFellow("requestAtDate");
        Timebox requestAtTime = (Timebox) getFellow("requestAtTime");
        Combobox statusCB = (Combobox) getFellow("status");
        Textbox requestMobilePhoneTB = (Textbox) getFellow("requestMobilePhone");
        Combobox urgentLevelCB = (Combobox) getFellow("urgentLevel");

        requestByTB.setText(form.getRequestBy());
        requestAtDate.setValue(form.getRequestAt());
        requestAtTime.setValue(form.getRequestAt());
        Iterator statusCBItr = statusCB.getItems().iterator();
        while (statusCBItr.hasNext()) {
            Comboitem item = (Comboitem) statusCBItr.next();
            if (item.getValue().toString().equals(form.getStatus())) {
                statusCB.setSelectedItem(item);
            }
        }
        requestMobilePhoneTB.setText(form.getRequestMobilePhone());

        Textbox requestMaintainNoTB = (Textbox) getFellow("requestMaintainNo");
        Combobox buildingCB = (Combobox) getFellow("building");
        Textbox requestReasonTB = (Textbox) getFellow("requestReason");
        Datebox firstResponseAtDate = (Datebox) getFellow("firstResponseAtDate");
        Timebox firstResponseAtTime = (Timebox) getFellow("firstResponseAtTime");
        Textbox responseMessageTB = (Textbox) getFellow("responseMessage");

        requestMaintainNoTB.setText(form.getRequestMaintainNo());
        Iterator buildingCBItr = buildingCB.getItems().iterator();
        while (buildingCBItr.hasNext()) {
            Comboitem item = (Comboitem) buildingCBItr.next();
            Building building = (Building) item.getValue();
            if (building.getBuildingId().toString().equals(form.getBuildingId().toString())) {
                buildingCB.setSelectedItem(item);
            }
        }
        requestReasonTB.setText(form.getRequestReason());
        firstResponseAtDate.setValue(form.getFirstResponseAt());
        firstResponseAtTime.setValue(form.getFirstResponseAt());
        responseMessageTB.setText(form.getResponseMessage());

        Datebox responseSolutionAtDate = (Datebox) getFellow("responseSolutionAtDate");
        Timebox responseSolutionAtTime = (Timebox) getFellow("responseSolutionAtTime");
        Textbox solutionMessageTB = (Textbox) getFellow("solutionMessage");

        responseSolutionAtDate.setValue(form.getResponseSolutionAt());
        responseSolutionAtTime.setValue(form.getResponseSolutionAt());
        solutionMessageTB.setText(form.getSolutionMessage());



    }
View Full Code Here


            }
        }

        Textbox requestByTB = (Textbox) getFellow("requestBy");
        Datebox requestAtDate = (Datebox) getFellow("requestAtDate");
        Timebox requestAtTime = (Timebox) getFellow("requestAtTime");
        Combobox statusCB = (Combobox) getFellow("status");
        Textbox requestMobilePhoneTB = (Textbox) getFellow("requestMobilePhone");
        Combobox urgentLevelCB = (Combobox) getFellow("urgentLevel");

        var.setRequestBy(requestByTB.getText());
        if (requestAtDate.getValue() != null
                && requestAtTime.getValue() != null) {
            Timestamp requestAt = new Timestamp(requestAtDate.getValue().getTime());
            requestAt.setHours(requestAtTime.getValue().getHours());
            requestAt.setMinutes(requestAtTime.getValue().getMinutes());
            var.setRequestAt(requestAt);
        }
        var.setStatus(statusCB.getSelectedItem().getValue().toString());
        var.setRequestMobilePhone(requestMobilePhoneTB.getText());
        var.setUrgentLevel(urgentLevelCB.getSelectedItem().getValue().toString());

        Textbox requestMaintainNoTB = (Textbox) getFellow("requestMaintainNo");
        Combobox buildingCB = (Combobox) getFellow("building");
        Textbox requestReasonTB = (Textbox) getFellow("requestReason");
        Datebox firstResponseAtDate = (Datebox) getFellow("firstResponseAtDate");
        Timebox firstResponseAtTime = (Timebox) getFellow("firstResponseAtTime");
        Textbox responseMessageTB = (Textbox) getFellow("responseMessage");

        var.setRequestMaintainNo(requestMaintainNoTB.getText());
        var.setBuilding((Building) buildingCB.getSelectedItem().getValue());
        var.setRequestReason(requestReasonTB.getText());
        if (firstResponseAtDate.getValue() != null
                && firstResponseAtTime.getValue() != null) {
            Timestamp firstResponseAt = new Timestamp(firstResponseAtDate.getValue().getTime());
            firstResponseAt.setHours(firstResponseAtTime.getValue().getHours());
            firstResponseAt.setMinutes(firstResponseAtTime.getValue().getMinutes());
            var.setFirstResponseAt(firstResponseAt);
        }


        var.setResponseMessage(responseMessageTB.getText());

        Datebox responseSolutionAtDate = (Datebox) getFellow("responseSolutionAtDate");
        Timebox responseSolutionAtTime = (Timebox) getFellow("responseSolutionAtTime");
        Textbox solutionMessageTB = (Textbox) getFellow("solutionMessage");

        if (responseSolutionAtDate.getValue() != null
                && responseSolutionAtTime.getValue() != null) {
            Timestamp responseSolutionAt = new Timestamp(responseSolutionAtDate.getValue().getTime());
            responseSolutionAt.setHours(responseSolutionAtTime.getValue().getHours());
            responseSolutionAt.setMinutes(responseSolutionAtTime.getValue().getMinutes());
            var.setResponseSolutionAt(responseSolutionAt);
        }
        var.setSolutionMessage(solutionMessageTB.getText());

        return var;
View Full Code Here

                authListbox.setSelectedItem(item);
            }
        }

        Datebox validAfterDate = (Datebox) getFellow("validAfterDate");
        Timebox validAfterTime = (Timebox) getFellow("validAfterTime");
        if (obj.getValidAfter() != null) {
            validAfterDate.setValue(obj.getValidAfter());
            validAfterTime.setValue(obj.getValidAfter());
        }

        Datebox validBeforeDate = (Datebox) getFellow("validBeforeDate");
        Timebox validBeforeTime = (Timebox) getFellow("validBeforeTime");
        if (obj.getValidBefore() != null) {
            validBeforeDate.setValue(obj.getValidBefore());
            validBeforeTime.setValue(obj.getValidBefore());
        }

    }
View Full Code Here

        var.setUser(user);
        Listbox authListbox = (Listbox) getFellow("auth");
        var.setAuth((Auth) (authListbox.getSelectedItem()).getValue());

        Datebox validAfterDate = (Datebox) getFellow("validAfterDate");
        Timebox validAfterTime = (Timebox) getFellow("validAfterTime");
        if (validAfterDate.getValue() != null
                && validAfterTime.getValue() != null) {
            Timestamp validAfter = new Timestamp(validAfterDate.getValue().getTime());
            validAfter.setHours(validAfterTime.getValue().getHours());
            validAfter.setMinutes(validAfterTime.getValue().getMinutes());
            var.setValidAfter(validAfter);
        }

        Datebox validBeforeDate = (Datebox) getFellow("validBeforeDate");
        Timebox validBeforeTime = (Timebox) getFellow("validBeforeTime");
        if (validBeforeDate.getValue() != null
                && validBeforeTime.getValue() != null) {
            Timestamp validBefore = new Timestamp(validBeforeDate.getValue().getTime());
            validBefore.setHours(validBeforeTime.getValue().getHours());
            validBefore.setMinutes(validBeforeTime.getValue().getMinutes());
            var.setValidBefore(validBefore);
        }

        return var;
    }
View Full Code Here

            return false;
        }

        if (!workReportLine
                .isClockStartMustBeNotNullIfIsCalculatedByClockConstraint()) {
            Timebox timeStart = getTimeboxStart(row);
            if (timeStart != null) {
                String message = _("cannot be empty");
                showInvalidMessage(timeStart, message);
            }
            return false;
        }

        if (!workReportLine
                .isClockFinishMustBeNotNullIfIsCalculatedByClockConstraint()) {
            Timebox timeFinish = getTimeboxFinish(row);
            if (timeFinish != null) {
                String message = _("cannot be empty");
                showInvalidMessage(timeFinish, message);
            }
            return false;
View Full Code Here

    }

    private void appendHoursStartAndFinish(final Row row) {
        final WorkReportLine line = (WorkReportLine) row.getValue();

        final Timebox timeStart = getNewTimebox();
        final Timebox timeFinish = getNewTimebox();

        row.appendChild(timeStart);
        row.appendChild(timeFinish);

        Util.bind(timeStart, new Util.Getter<Date>() {
View Full Code Here

        line.setClockStart(timeStart.getValue());
        line.setClockFinish(timeFinish.getValue());
    }

    private Timebox getNewTimebox() {
        final Timebox timeStart = new Timebox();
        timeStart.setWidth("60px");
        timeStart.setFormat("short");
        timeStart.setButtonVisible(true);
        return timeStart;
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Timebox

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.