Package org.zkoss.zul

Examples of org.zkoss.zul.ListModelList


        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        List buildingDocList = sess.selectList("Duty.getAll", var.getUserId());
        sess = null;

        subListModel = new ListModelList(buildingDocList, true);
        subListbox.setModel(subListModel);
        subListbox.setItemRenderer(buildingDocListRenderer);

        buildingDocList = null;
    }
View Full Code Here


        SqlSession sess = IBatisFactory.getInstance().getSqlSession();
        List authList = sess.selectList("Auth.getAll");
        sess = null;

        ListModel authModel = new ListModelList(authList, true);
        authListbox.setModel(authModel);
        authListbox.setItemRenderer(authListRenderer);
    }
View Full Code Here

      if (source instanceof ListModel) {
        return source;
      } else if (source instanceof Set) {
        return new ListModelSet((Set)source, true);
      } else if (source instanceof List) {
        return new ListModelList((List)source, true);
      } else if (source instanceof Map) {
        return new ListModelMap((Map)source, true);
      } else if (source instanceof Object[]) {
        return new ListModelArray((Object[]) source, true);
      } else if ((source instanceof Class) && Enum.class.isAssignableFrom((Class)source)) {
View Full Code Here

  private String message;

  public ListModelList getOrders() {
    if (orders == null) {
      //init the list
      orders = new ListModelList(getService().list());
    }
    return orders;
  }
View Full Code Here

      listBoxSecRights = null;
    }

    // +++++++++ DropDown ListBox
    // set listModel and itemRenderer for the dropdown listbox
    rigType.setModel(new ListModelList(getSecurityService().getAllTypes()));
    rigType.setItemRenderer(new SecRightSecTypListModelItemRenderer());

    // if available, select the object
    ListModelList lml = (ListModelList) rigType.getModel();
    SecTyp typ = getSecurityService().getTypById(right.getRigType().intValue());

    if (right.isNew()) {
      rigType.setSelectedIndex(-1);
    } else {
      rigType.setSelectedIndex(lml.indexOf(typ));
    }

    // set Field Properties
    doSetFieldProperties();
View Full Code Here

        } catch (DataAccessException e) {
          ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
        }

        // now synchronize the listBox
        final ListModelList lml = (ListModelList) listBoxSecRights.getListModel();

        // Check if the object is new or updated
        // -1 means that the obj is not in the list, so it's
        // new..
        if (lml.indexOf(aRight) == -1) {
        } else {
          lml.remove(lml.indexOf(aRight));
        }

        secRightDialogWindow.onClose(); // close
      }
    }
View Full Code Here

      } catch (final InterruptedException e) {
        throw new RuntimeException(e);
      }
      return;
    }
    ListModelList lml1 = (ListModelList) rigType.getListModel();
    SecTyp typ = (SecTyp) lml1.get(item.getIndex());
    aRight.setRigType(Integer.valueOf(typ.getStpId()));

    // save it to database
    try {
      getSecurityService().saveOrUpdate(aRight);
    } catch (DataAccessException e) {
      ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());

      // Reset to init values
      doResetInitValues();

      doReadOnly();
      btnCtrl.setBtnStatus_Save();
      return;
    }

    // now synchronize the listBox
    ListModelList lml = (ListModelList) this.listBoxSecRights.getListModel();

    // Check if the object is new or updated
    // -1 means that the obj is not in the list, so it's new.
    if (lml.indexOf(aRight) == -1) {
      lml.add(aRight);
    } else {
      lml.set(lml.indexOf(aRight), aRight);
    }

    doReadOnly();
    btnCtrl.setBtnStatus_Save();
    // init the old values vars new
View Full Code Here

    listheader_SecRightList_rigType.setSortAscending(new FieldComparator("rigType", true));
    listheader_SecRightList_rigType.setSortDescending(new FieldComparator("rigType", false));

    // ++++++++++++++ DropDown ListBox ++++++++++++++++++ //
    // set listModel and itemRenderer for the dropdown listbox
    lb_secRight_RightType.setModel(new ListModelList(getSecurityService().getAllTypes()));
    lb_secRight_RightType.setItemRenderer(new SecRightSecTypListModelItemRenderer());

    ListModelList lml = (ListModelList) lb_secRight_RightType.getModel();
    // we added an empty SecType simulated the (-1) for showing all records.
    lml.add(0, SecTyp.EMPTY_SECTYP);

    // ++ create the searchObject and init sorting ++//
    HibernateSearchObject<SecRight> soSecRight = new HibernateSearchObject<SecRight>(SecRight.class, getCountRows());
    soSecRight.addSort("rigName", false);
View Full Code Here

      listBoxUser = null;
    }

    // +++++++++ DropDown ListBox
    // set listModel and itemRenderer for the dropdown listbox
    lbox_usrLocale.setModel(new ListModelList(getUserService().getAllLanguages()));
    lbox_usrLocale.setItemRenderer(new LanguageListModelItemRenderer());

    // if available, select the object
    ListModelList lml = (ListModelList) lbox_usrLocale.getModel();

    /**
     * check if the user is new ( means: userID == Long.MIN_VALUE )<br>
     * If new than it's not a transient hibernate object and an error occur
     * by using this ID for a hibernate query<br>
     */
    if (user.isNew()) {
      lbox_usrLocale.setSelectedIndex(-1);
    } else {
      // Set the ListModel and the itemRenderer.
      listBoxDetails_UserRoles.setModel(new ListModelList(getUserService().getRolesByUser(getUser())));
      listBoxDetails_UserRoles.setItemRenderer(new UserRolesListModelItemRenderer());

      if (!StringUtils.isEmpty(user.getUsrLocale())) {
        Language lang = getUserService().getLanguageByLocale(user.getUsrLocale());
        lbox_usrLocale.setSelectedIndex(lml.indexOf(lang));
      }
    }

    doShowDialog(getUser());
  }
View Full Code Here

            } catch (DataAccessException e) {
              ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
            }

            // now synchronize the listBox
            final ListModelList lml = (ListModelList) listBoxUser.getListModel();

            // Check if the object is new or updated
            // -1 means that the obj is not in the list, so
            // it's
            // new..
            if (lml.indexOf(anUser) == -1) {
            } else {
              lml.remove(lml.indexOf(anUser));
            }
          }
        } catch (final Exception e) {
          // TODO: handle exception
        }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.ListModelList

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.