Package org.zkoss.zul

Examples of org.zkoss.zul.Comboitem


        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());
View Full Code Here


            return TypeConverter.IGNORE;
          }
          final BindingListModel model = (BindingListModel) xmodel;
          int index = model.indexOf(val);
          if (index >= 0 && cbbox.getItemCount() > index) {
            final Comboitem item = (Comboitem) cbbox.getItemAtIndex(index);
            //Bug #2728704: Listbox with databinding generates onSelect w/o user action
            //Shall not fire event by spec. For backward compatibility(still want to
            //fire onSelect event as usual), user can specifies in zk.xml
            //<library-property>
            //  <name>org.zkoss.zkplus.databind.onSelectWhenLoad</name>
            //  <value>true</value>
            //</library-property>
            //then data binder will still fire the onSelect event as usual.
            if (SelectedItemConverter.isOnSelectWhenLoad()) {
              final int selIndex = cbbox.getSelectedIndex();
             
              //We need this to support load-when:onSelect
              if (item != null && selIndex != index) { // bug 1647817, avoid endless-loop
                Set items = new HashSet();
                items.add(item);
                //bug #2140491
                Executions.getCurrent().setAttribute("zkoss.zkplus.databind.ON_SELECT"+cbbox.getUuid(), Boolean.TRUE);
                Events.postEvent(new SelectEvent("onSelect", cbbox, items, item));
              }
            }
            return item;
          }
        } else if (xmodel == null) { //no model case, assume Comboitem.value to be used with selectedItem
          //iterate to find the selected item assume the value (select mold)
          for (final Iterator it = cbbox.getItems().iterator(); it.hasNext();) {
            final Comboitem li = (Comboitem) it.next();
            if (val.equals(li.getValue())) {
              return li;
            }
          }
        } else {
          throw new UiException("model of the databind combobox "+cbbox+" must be an instanceof of org.zkoss.zkplus.databind.BindingListModel." + xmodel);
View Full Code Here



        while (it.hasNext()) {
            Org s = (Org) it.next();
            Comboitem item = new Comboitem();
            item.setValue(s);
            item.setLabel(s.getOrgName());
            item.setParent(orgIdCB);




        }
View Full Code Here

        Textbox accountTB = (Textbox) getFellow("account");
        Textbox passwdTB = (Textbox) getFellow("passwd");

        Iterator supplierIt = orgIdCB.getItems().iterator();
        while (supplierIt.hasNext()) {
            Comboitem item = (Comboitem) supplierIt.next();
            Org s = (Org) item.getValue();

            logger.debug("" + var.getOrgId() + ", " + s.getOrgId());
            if (var.getOrgId() != null && var.getOrgId() == s.getOrgId()) {
                orgIdCB.setSelectedItem(item);
            }
View Full Code Here

        passwdTB.setText(var.getPasswd());
    }

    public void query() {
        Combobox orgIdCB = (Combobox) getFellow("orgId");
        Comboitem itemVar = orgIdCB.getSelectedItem();
        String queryString = null;
        Map para = new HashMap();

        logger.debug("--->itemVar: " + itemVar);
        if (itemVar != null) {
            queryString = orgIdCB.getSelectedItem().getLabel();
            para.put("orgName", queryString);
        } else {
            para.put("orgName", null);
        }

        refreshObjEntities(para);

        // empty all fields , except the query condition field
        UserForm emptyObj = new UserForm();
        objToView(emptyObj);

        Iterator supplierIt = orgIdCB.getItems().iterator();
        while (supplierIt.hasNext()) {
            Comboitem item = (Comboitem) supplierIt.next();
            Org s = (Org) item.getValue();

            if (queryString != null && queryString.equals(s.getOrgName())) {
                orgIdCB.setSelectedItem(item);
            }
        }
View Full Code Here

        logger.debug("org CB size:" + keyValueList.size());

        Iterator it = keyValueList.iterator();
        while (it.hasNext()) {
            Org orgList = (Org) it.next();
            Comboitem item = new Comboitem();
            item.setValue(orgList);
            item.setLabel(orgList.getOrgName());
            item.setParent(orgIdCB);
        }
    }
View Full Code Here

    public void query() {
        // get list

        Combobox orgCB = (Combobox) this.getFellow("OrgId");
        Comboitem orgCbItem = orgCB.getSelectedItem();
        String queryOrgName = ((Org) orgCbItem.getValue()).getOrgName();
        Map para = new HashMap();
        para.put("HashMap", queryOrgName);

        System.out.println("CCCCCCCCCCCCCCCCCCCC" + queryOrgName);
        refreshObjEntities(para);
View Full Code Here

        Textbox accountTB = (Textbox) getFellow("Account");
        Textbox passwdTB = (Textbox) getFellow("Passwd");

        Iterator orgCbIt = orgCB.getItems().iterator();
        while (orgCbIt.hasNext()) {
            Comboitem orgCbItem = (Comboitem) orgCbIt.next();
            Org org = (Org) orgCbItem.getValue();

            logger.debug("" + var.getOrgId() + ", " + org.getOrgId());
            if (var.getOrgId() != null && var.getOrgId() == org.getOrgId()) {
                orgCB.setSelectedItem(orgCbItem);
            }
View Full Code Here

        // show the service
        Combobox serviceCB = (Combobox) getFellow("service");
        for (int index = 0; index < ServiceList.size(); index++) {
            Service service = (Service) ServiceList.get(index);
            Comboitem item = new Comboitem();
            item.setLabel(service.getServiceName());
            item.setValue(service);
            item.setParent(serviceCB);
        }
    }
View Full Code Here

        Combobox activeFlagCb = (Combobox) getFellow("ActiveFlag");
        Iterator activeFlagIt = activeFlagList.iterator();
        while (activeFlagIt.hasNext()) {
            FunForm activeFlag = (FunForm) activeFlagIt.next();
            Comboitem activeFlagItem = new Comboitem();
            activeFlagItem.setValue(activeFlag.getActiveFlag());
            activeFlagItem.setLabel(activeFlag.getActiveFlagString());
            activeFlagItem.setParent(activeFlagCb);
        }

        Combobox bootFlagCb = (Combobox) getFellow("BootFlag");
        Iterator bootFlagIt = bootFlagList.iterator();
        while (bootFlagIt.hasNext()) {
            FunForm bootFlag = (FunForm) bootFlagIt.next();
            Comboitem bootFlagItem = new Comboitem();
            bootFlagItem.setValue(bootFlag.getBootFlag());
            bootFlagItem.setLabel(bootFlag.getBootFlagString());
            bootFlagItem.setParent(bootFlagCb);
        }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Comboitem

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.