Package org.zkoss.zul

Examples of org.zkoss.zul.Combobox$Renderer


        delete(dao, obj);
    }

    public void objToView(Object obj) {
        MaintainEventType var = (MaintainEventType) obj;
        Combobox systemTypeCB = (Combobox) getFellow("system");
        Textbox maintainEventTypeTB = (Textbox) getFellow("maintainEventType");

        Iterator stItr = systemTypeCB.getItems().iterator();
        while (stItr.hasNext()) {
            Comboitem item = (Comboitem) stItr.next();
            String s = (String) item.getValue();
            if (s.equals(var.getSystemType())) {
                systemTypeCB.setSelectedItem(item);
            }
        }
       
        maintainEventTypeTB.setText(var.getMaintainEventType());
View Full Code Here


            } catch (Exception iae) {
                iae.printStackTrace();
            }
        }

        Combobox systemTypeCB = (Combobox) getFellow("system");
        Textbox maintainEventTypeTB = (Textbox) getFellow("maintainEventType");

        var.setSystemType(systemTypeCB.getSelectedItem().getValue().toString());
        var.setMaintainEventType(maintainEventTypeTB.getText());

        return var;
    }
View Full Code Here

       
        changeBuilding(building);
    }

    public void initEquipmentBySystem() {
        Combobox systemCB = (Combobox) getFellow("system");
        logger.debug("user select system  type: " + systemCB.getSelectedItem().getValue().toString());
        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        List equipmentList = sess.selectList("Equipment.initEquipmentBySystem",
                systemCB.getSelectedItem().getValue().toString());
        sess = null;
        // remove all in equipment Combobox
        Combobox equipmentCB = (Combobox) getFellow("equipment");
        int itemCount = equipmentCB.getItemCount();
        for (int i = 0; i < itemCount; i++) {
            equipmentCB.removeItemAt(0);
        }
        // re-set equipment combobox
        Iterator it = equipmentList.iterator();
        while (it.hasNext()) {
            EquipmentForm ef = (EquipmentForm) it.next();
View Full Code Here

            item.setParent(equipmentCB);
        }
    }

    public void setSupplierInfo() {
        Combobox equipmentCB = (Combobox) getFellow("equipment");
        EquipmentForm ef = (EquipmentForm) equipmentCB.getSelectedItem().getValue();

        // show supplier name
        Textbox supplierNameTB = (Textbox) getFellow("supplierName");
        supplierNameTB.setText(ef.getSupplierName());

        // show priority
        Combobox priorityCB = (Combobox) getFellow("priority");
        for (int i = 0; i < priorityCB.getItemCount(); i++) {
            String priority = priorityCB.getItemAtIndex(i).getValue().toString();
            if (priority.equals(ef.getPriority())) {
                priorityCB.setSelectedIndex(i);
                break;
            }
        }

        Textbox propertyCodeTB = (Textbox) getFellow("propertyCode");
View Full Code Here

        BomForm form = (BomForm) obj;

        Listbox buildingListbox = (Listbox) getFellow("buildingListbox");
        Textbox floorTB = (Textbox) getFellow("floor");
        Textbox regionTB = (Textbox) getFellow("region");
        Combobox systemCB = (Combobox) getFellow("system");
        Combobox equipmentCB = (Combobox) getFellow("equipment");

        floorTB.setText(form.getFloor());
        regionTB.setText(form.getRegion());
        Iterator systemCBItr = systemCB.getItems().iterator();
        while (systemCBItr.hasNext()) {
            Comboitem item = (Comboitem) systemCBItr.next();
            if (item.getValue().toString().equals(form.getSystemType())) {
                systemCB.setSelectedItem(item);
            }
        }
        initEquipmentBySystem();

        Iterator equipmentCBItr = equipmentCB.getItems().iterator();
        while (equipmentCBItr.hasNext()) {
            Comboitem item = (Comboitem) equipmentCBItr.next();
            Equipment equ = (Equipment) item.getValue();
            if (equ.getEquipmentId().equals(form.getEquipmentId())) {
                equipmentCB.setSelectedItem(item);
            }
        }

        Textbox supplierNameTB = (Textbox) getFellow("supplierName");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Textbox propertyCodeTB = (Textbox) getFellow("propertyCode");
        Textbox descriptionTB = (Textbox) getFellow("description");


        supplierNameTB.setText(form.getSupplierShortName());
        Iterator priorityCBItr = priorityCB.getItems().iterator();
        while (priorityCBItr.hasNext()) {
            Comboitem item = (Comboitem) priorityCBItr.next();
            if (item.getValue().toString().equals(form.getPriority())) {
                priorityCB.setSelectedItem(item);
            }
        }
        propertyCodeTB.setText(form.getPropertyCode());
        descriptionTB.setText(form.getDescription());
View Full Code Here

    private int queryCount = 0;
    private List queryMatched = null;

    public void query() {

        Combobox equipmentCB = (Combobox) getFellow("equipment");
        EquipmentForm ef = (EquipmentForm) equipmentCB.getSelectedItem().getValue();

        Tree objTree = (Tree) getFellow("objTree");

        Collection items = objTree.getItems();
View Full Code Here

                iae.printStackTrace();
            }
        }

        Listbox buildingListbox = (Listbox) getFellow("buildingListbox");
        Combobox equipmentCB = (Combobox) getFellow("equipment");

        Textbox floorTB = (Textbox) getFellow("floor");
        Textbox regionTB = (Textbox) getFellow("region");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Textbox propertyCodeTB = (Textbox) getFellow("propertyCode");
        Textbox descriptionTB = (Textbox) getFellow("description");

        Building building = (Building) buildingListbox.getSelectedItem().getValue();
        var.setBuilding(building);

        Equipment equ = (Equipment) equipmentCB.getSelectedItem().getValue();
        var.setEquipment(equ);

        var.setFloor(floorTB.getText());
        var.setRegion(regionTB.getText());
        var.setPriority(priorityCB.getSelectedItem().getValue().toString());
        var.setPropertyCode(propertyCodeTB.getText());
        var.setDescription(descriptionTB.getText());


        return var;
View Full Code Here

        initSupplierIdCB();
        refreshObjEntities();
    }

    private void initSupplierIdCB() {
        Combobox supplierIdCB = (Combobox) getFellow("supplierId");
        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        List keyValueList = sess.selectList("Supplier.getName_Id");
        sess = null;
        logger.debug("supplier CB size:" + keyValueList.size());
View Full Code Here

            }
        }

        Radiogroup isEquipment = (Radiogroup) getFellow("isEquipment");
        Textbox equipmentNameTB = (Textbox) getFellow("equipmentName");
        Combobox supplierIdCB = (Combobox) getFellow("supplierId");
        Textbox pccCodeTB = (Textbox) getFellow("pccCode");
        Textbox venderCodeTB = (Textbox) getFellow("venderCode");

        obj.setIsEquipment(isEquipment.getSelectedItem().getValue());
        obj.setEquipmentName(equipmentNameTB.getText());
        obj.setSupplier((Supplier) supplierIdCB.getSelectedItem().getValue());
        obj.setPccCode(pccCodeTB.getText());
        obj.setVenderCode(venderCodeTB.getText());

        Textbox insideCodeTB = (Textbox) getFellow("insideCode");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
        Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
        Combobox systemTypeCB = (Combobox) getFellow("system");
        obj.setInsideCode(insideCodeTB.getText());
        obj.setPriority(priorityCB.getSelectedItem().getValue().toString());
        obj.setLatestPrice(latestPriceTB.getValue());
        obj.setInventoryAmount(inventoryAmountTB.getValue());
        obj.setSystemType(systemTypeCB.getSelectedItem().getValue().toString());

        return obj;
    }
View Full Code Here

    public void objToView(Object obj) {
        EquipmentForm var = (EquipmentForm) obj;

        Radiogroup isEquipment = (Radiogroup) getFellow("isEquipment");
        Textbox equipmentNameTB = (Textbox) getFellow("equipmentName");
        Combobox supplierIdCB = (Combobox) getFellow("supplierId");
        Textbox pccCodeTB = (Textbox) getFellow("pccCode");
        Textbox venderCodeTB = (Textbox) getFellow("venderCode");

        Iterator it = isEquipment.getItems().iterator();
        while (it.hasNext()) {
            Radio radio = (Radio) it.next();
            if (radio.getValue().equals(var.getIsEquipment())) {
                radio.setChecked(true);
            }
        }

        equipmentNameTB.setText(var.getEquipmentName());

        Iterator supplierIt = supplierIdCB.getItems().iterator();
        while (supplierIt.hasNext()) {
            Comboitem item = (Comboitem) supplierIt.next();
            Supplier s = (Supplier) item.getValue();
            if (var.getSupplierId() != null && var.getSupplierId() == s.getSupplierId()) {
                supplierIdCB.setSelectedItem(item);
            }
        }

        pccCodeTB.setText(var.getPccCode());
        venderCodeTB.setText(var.getVenderCode());

        Textbox insideCodeTB = (Textbox) getFellow("insideCode");
        Combobox priorityCB = (Combobox) getFellow("priority");
        Doublebox latestPriceTB = (Doublebox) getFellow("latestPrice");
        Intbox inventoryAmountTB = (Intbox) getFellow("inventoryAmount");
        Combobox systemTypeCB = (Combobox) getFellow("system");

        insideCodeTB.setText(var.getInsideCode());
        Iterator priorityIt = priorityCB.getItems().iterator();
        while (priorityIt.hasNext()) {
            Comboitem item = (Comboitem) priorityIt.next();

            String priorityStr = item.getValue().toString();
            if (var.getPriority() != null && var.getPriority().equals(priorityStr)) {
                priorityCB.setSelectedItem(item);
            }
        }
        latestPriceTB.setValue(var.getLatestPrice());
        inventoryAmountTB.setValue(var.getInventoryAmount());

        Iterator stItr = systemTypeCB.getItems().iterator();
        while (stItr.hasNext()) {
            Comboitem item = (Comboitem) stItr.next();
            String s = (String) item.getValue();
            if (s.equals(var.getSystemType())) {
                systemTypeCB.setSelectedItem(item);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Combobox$Renderer

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.