Package org.zkoss.zul

Examples of org.zkoss.zul.Listbox$ItemIter


        bd.open();
    }

    public void onCtrlKey(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        List<Listitem> items = listbox.getItems();
        if (!items.isEmpty()) {
            listbox.setSelectedIndex(0);
            items.get(0).setFocus(true);
        }
    }
View Full Code Here


    }

    public void onChangingText(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        final String inputText = ((InputEvent) event).getValue();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        listbox.setModel(getSubModel(inputText));
        listbox.invalidate();
        bd.open();
    }
View Full Code Here

        bd.open();
    }

    public void onCtrlKey(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        List<Listitem> items = listbox.getItems();
        if (!items.isEmpty()) {
            listbox.setSelectedIndex(0);
            items.get(0).setFocus(true);
        }
    }
View Full Code Here

    }

    private void appendListboxPositionDescriptionField(final Row row) {
        final DescriptionField descriptionField = (DescriptionField) row
                .getValue();
        final Listbox listPosition = createListPosition();
        listPosition.setParent(row);

        if (workReportTypeModel.isHeadingDescriptionField(descriptionField)) {
            listPosition.setSelectedItem(listPosition.getItemAtIndex(0));
        } else {
            listPosition.setSelectedItem(listPosition.getItemAtIndex(1));
        }

        listPosition.addEventListener(Events.ON_SELECT, new EventListener() {
            @Override
            public void onEvent(Event event) {
                changePositionDescriptionField(listPosition
                            .getSelectedItem(), descriptionField);
                Util.reloadBindings(listDescriptionFields);
            }
        });
    }
View Full Code Here

            }
        });
    }

    private Listbox createListPosition() {
        final Listbox listPosition = new Listbox();
        listPosition.setMold("select");

        listPosition.setModel(new SimpleListModel(
                getPositionInWorkReportEnums()));
        listPosition.setItemRenderer(new EnumsListitemRenderer());
        return listPosition;
    }
View Full Code Here

    private void appendComboboxPositionLabel(final Row row) {
        final WorkReportLabelTypeAssigment workReportLabelTypeAssigment = (WorkReportLabelTypeAssigment) row
                .getValue();

        final Listbox listPosition = this.createListPosition();
        listPosition.setParent(row);

        if (workReportLabelTypeAssigment.getLabelsSharedByLines()) {
            listPosition.setSelectedItem(listPosition.getItemAtIndex(0));
        } else {
            listPosition.setSelectedItem(listPosition.getItemAtIndex(1));
        }

        listPosition.addEventListener(Events.ON_SELECT, new EventListener() {
            @Override
            public void onEvent(Event event) {
                changePositionLabel(listPosition.getSelectedItem(),
                            workReportLabelTypeAssigment);
                Util.reloadBindings(listWorkReportLabelTypeAssigments);
            }
        });
View Full Code Here

    private void showInvalidValue(HourCost hourCost) {
        Row row = ComponentsFinder.findRowByValue(listHourCosts, hourCost);
        if (row != null) {
            if (hourCost.getType() == null) {
                Listbox workHoursType = getWorkHoursType(row);
                String message = workHoursType.getItems().isEmpty() ? _("Hours types are empty. Please, create some hours types before proceeding")
                        : _("cannot be empty");
                throw new WrongValueException(getWorkHoursType(row), message);
            }
            if (hourCost.getPriceCost() == null) {
                throw new WrongValueException(getPricePerHour(row), _("cannot be empty"));
View Full Code Here

     *
     * @param row
     */
    private void appendHoursType(final Row row) {
        final HourCost hourCost = (HourCost) row.getValue();
        final Listbox lbHoursType = new Listbox();
        lbHoursType.setMold("select");
        lbHoursType.setModel(allHoursType);
        lbHoursType.renderAll();
        lbHoursType.applyProperties();

        if (lbHoursType.getItems().isEmpty()) {
            row.appendChild(lbHoursType);
            return;
        }

        // First time is rendered, select first item
        TypeOfWorkHours type = hourCost.getType();
        if (hourCost.isNewObject() && type == null) {
            Listitem item = lbHoursType.getItemAtIndex(0);
            item.setSelected(true);
            setHoursType(hourCost, item);
        } else {
            // If hoursCost has a type, select item with that type
            Listitem item = ComponentsFinder.findItemByValue(lbHoursType, type);
            if (item != null) {
                lbHoursType.selectItem(item);
            }
        }

        lbHoursType.addEventListener(Events.ON_SELECT, new EventListener() {

            @Override
            public void onEvent(Event event) {
                Listitem item = lbHoursType.getSelectedItem();
                if (item != null) {
                    setHoursType((HourCost) row.getValue(), item);
                }
            }

View Full Code Here

        }
        return true;
    }

    public void validateCalendarExceptionCodes(){
        Listbox listbox = (Listbox) window.getFellow("exceptionsList");
        if (listbox != null) {
            for (int i = 0; i < listbox.getItemCount(); i++) {
                Listitem item = (Listitem) listbox.getItems().get(i);
                if (item.getChildren().size() == 5) {
                    Textbox code = (Textbox) ((Listcell) item.getChildren()
                            .get(3)).getFirstChild();
                    if (code != null && !code.isDisabled()
                            && code.getValue().isEmpty()) {
View Full Code Here

        reloadExceptionsList();
        reloadActivationPeriods();
    }

    public void onSelectException(Event event) {
        Listbox listBox = (Listbox) event.getTarget();
        Listitem item = (Listitem) listBox.getSelectedItem();
        if (item != null) {
            CalendarException calendarException = (CalendarException) item
                .getValue();
            setSelectedDay(calendarException.getDate());
            reloadDayInformation();
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Listbox$ItemIter

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.