Package org.zkoss.zul

Examples of org.zkoss.zul.ListModel


      //triggered by coerceToUi(), ignore this
      Executions.getCurrent().removeAttribute("zkoss.zkplus.databind.ON_SELECT"+cbbox.getUuid());
      return TypeConverter.IGNORE;
    }
      if (val != null) {
        final ListModel model = cbbox.getModel();
        //Bug #2010389
        //1. loadAll
        //2. setModel (by 1.), post onInitRender.
        //3. setSelectedItem (by 1.), coerceToUi, post onSelect with OLD Comboitem.
        //4. onInitRender(by 2.), syncModel and reconstruct new Comboitem(s) list, fire onInitRenderLater 
        //** 5. save (by 3.), coreceToBean with OLD Comboitem, cannot locate the index with indexOf()
        //6. onInitRenderLater(by 4.), setSelectedItem, coerceToUi, post onSelect with new Comboitem
       
        //no model case, assume Comboitem.value to be used with selectedItem
       return model != null ? model.getElementAt(cbbox.getItems().indexOf(val)) : ((Comboitem) val).getValue();
     }
     return null;
  }
View Full Code Here


   * @since 3.0.2
   */
  public Object coerceToUi(Object val, Component comp) {
    final Combobox cbbox = (Combobox) comp;
      if (val != null) {
        final ListModel xmodel = cbbox.getModel();
     
        if (xmodel instanceof BindingListModel) {
          //Bug #2010389
          //if combobox is going to do onInitRender (syncModel), no need to setSelectedItem
          if (cbbox.getAttribute("zul.Combobox.ON_INITRENDER") != 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

      } else {
        throw new UiException("Expects java.util.Set, java.util.List, java.util.Map, Object[], Enum Class, or ListModel only. "+source.getClass());
      }
    } else {
      Constructor emptyConstructor = ClassUtils.getConstructorIfAvailable(targetClass, new Class[] {});
      ListModel model = (ListModel) emptyConstructor.newInstance(new Object[] {source, Boolean.TRUE});
      return model;
    }
  }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private ListModel getSubModel(String inputText) {
        List result = new ArrayList();

        final ListModel finderModel = finder.getModel();
        for (int i = 0; i < finderModel.getSize(); i++) {
            Object obj = finderModel.getElementAt(i);
            if (finder.entryMatchesText(obj, inputText)) {
                result.add(obj);
            }
        }
        return new SimpleListModel(result);
View Full Code Here

TOP

Related Classes of org.zkoss.zul.ListModel

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.