Package org.zkoss.zul

Examples of org.zkoss.zul.Combobox$Renderer


    }

    private boolean validate() {
        boolean isValid = true;
        Combobox systemCB = (Combobox) getFellow("system");
        Combobox typeCB = (Combobox) getFellow("type");
        Textbox fileNameTextbox = (Textbox) getFellow("fileNameTextbox");

        if (systemCB.getSelectedItem() == null
                || typeCB.getSelectedItem() == null
                || fileNameTextbox.getText() == null
                || "".equals(fileNameTextbox.getText())) {
            isValid = false;
            showMsg("請選取系統別, 資料別 或上傳檔案", "必要的選項");
        }
View Full Code Here


        return isValid;
    }

    private void formToView(BuildingDocForm form) {
        Combobox systemCB = (Combobox) getFellow("system");
        systemCB.setSelectedItem(this.getSelectedIndex(systemCB, form.getSystemType()));

        Combobox typeCB = (Combobox) getFellow("type");
        typeCB.setSelectedItem(this.getSelectedIndex(typeCB, form.getModelType()));

        Textbox fileNameTextbox = (Textbox) this.getFellow("fileNameTextbox");
        fileNameTextbox.setText(form.getModelFileName());

        Label formatLable = (Label) getFellow("format");
View Full Code Here

    private BuildingDocForm viewToForm() {
        if (buildingDocForm == null) {
            buildingDocForm = new BuildingDocForm();
        }

        Combobox cb = (Combobox) getFellow("system");
        String systemType = cb.getSelectedItem().getValue().toString();

        Combobox typeCb = (Combobox) getFellow("type");
        String modelType = typeCb.getSelectedItem().getValue().toString();

        Textbox fileNameTextbox = (Textbox) this.getFellow("fileNameTextbox");
        String modelFileName = fileNameTextbox.getText();

        Label formatLabel = (Label) getFellow("format");
View Full Code Here

    }

    protected void initComboboxByPara(String comboboxGetFellowName, String paraCatalogue) {
        List paraList = ParaCache.getInstance().getByCatalogue(paraCatalogue);
        Combobox cb = (Combobox) getFellow(comboboxGetFellowName);
        Iterator it = paraList.iterator();
        while (it.hasNext()) {
            Para obj = (Para) it.next();
            Comboitem item = new Comboitem();
            item.setLabel(obj.getParaValue());
View Full Code Here

    }
  }

  public ListModel getModelByOwner(Component comp) {
    if (comp instanceof Combobox) {
      final Combobox cbbox = (Combobox) comp;
      return cbbox.getModel();
    } else {
      throw new UiException(
          "Unsupported type for ComboitemCollectionItem: " + comp);
    }
  }
View Full Code Here

  }

  public void setupBindingRenderer(Component comp, DataBinder binder) {
    if (comp instanceof Comboitem) {
      final Comboitem li = (Comboitem) comp;
      final Combobox cbbox = (Combobox) li.getParent();
      if (cbbox.getItemRenderer() == null) {
        cbbox.setItemRenderer(new BindingComboitemRenderer(li, binder));
      }
    }
  }
View Full Code Here

    }
  }

  public List getItems(Component comp) {
    if (comp instanceof Combobox) {
      final Combobox cbbox = (Combobox) comp;
      return cbbox.getItems();
    } else {
      throw new UiException(
          "Unsupported type for ComboitemCollectionItem: " + comp);
    }
  }
View Full Code Here

        initCompanyCombobox();
        refreshObjEntities();
    }

    private void initCompanyCombobox() {
        Combobox companyCB = (Combobox) getFellow("company");

        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        List keyValueList = sess.selectList("Org.getAllCompany");
        sess = null;
View Full Code Here

        MechanicForm form = (MechanicForm) obj;

        Radiogroup hasCitizenshipRG = (Radiogroup) getFellow("hasCitizenship");
        Textbox mechanicNameTB = (Textbox) getFellow("mechanicName");
        Textbox uniIdTB = (Textbox) getFellow("uniId");
        Combobox companyCB = (Combobox) getFellow("company");
        Radiogroup sexRG = (Radiogroup) getFellow("sex");

        Iterator it = hasCitizenshipRG.getItems().iterator();
        while (it.hasNext()) {
            Radio r = (Radio) it.next();
            if (r.getValue().equals(form.getHasCitizenship())) {
                r.setChecked(true);
            }
        }
        mechanicNameTB.setText(form.getMechanicName());
        uniIdTB.setText(form.getUniId());

        boolean mechanicBelongToCompany = false;
        Iterator companyCBItr = companyCB.getItems().iterator();
        while (companyCBItr.hasNext()) {
            Comboitem item = (Comboitem) companyCBItr.next();
            Org varCompany = (Org) item.getValue();
            if (form.getCompanyId() != null
                    && varCompany.getOrgId().equals(form.getCompanyId())) {
                companyCB.setSelectedItem(item);
                form.setCompany(varCompany); // if has company, re-link it now
                mechanicBelongToCompany = true;
            }
          
        }
        if(!mechanicBelongToCompany){
            companyCB.setValue("please");
        }

       
        Iterator sexRGItr = sexRG.getItems().iterator();
        while (sexRGItr.hasNext()) {
View Full Code Here


        Radiogroup hasCitizenshipRG = (Radiogroup) getFellow("hasCitizenship");
        Textbox mechanicNameTB = (Textbox) getFellow("mechanicName");
        Textbox uniIdTB = (Textbox) getFellow("uniId");
        Combobox companyCB = (Combobox) getFellow("company");
        Radiogroup sexRG = (Radiogroup) getFellow("sex");

        var.setHasCitizenship(
                hasCitizenshipRG.getSelectedItem().getValue());
        var.setMechanicName(mechanicNameTB.getText());
        var.setUniId(uniIdTB.getText());
        if (companyCB.getSelectedItem() != null) {
            var.setCompany((Org) companyCB.getSelectedItem().getValue());
        }
        var.setSex(sexRG.getSelectedItem().getValue());


        Datebox birthdayDB = (Datebox) getFellow("birthday");
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.