Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1494

Chosenbox not work in listbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Major Major
    • None
    • 6.5.0
    • Components
    • firefox

      chosenbox not work in listbox (in listcell) with MVVM

      throw exception org.zkoss.zk.ui.UiException: Listitem's parent must be Listbox, not <Chosenbox lC6Pi8>

      {SAMPLE CODE BELOW}

      ZUL page code as :-

      <listcell >
      <chosenbox model="@load(vm.entityMasterList)">
      </chosenbox>
      </listcell>

      ViewModel code as :-
      public ListModel getEntityMasterList()

      { return ListModels.toListSubModel(new ListModelList(entityMasterList),new CustomerSortComparator(),10); }

      /**

      • Class CustomerSortComparator
      • @author Administrator
        *
        */
        class CustomerSortComparator implements Comparator<Object>
        Unknown macro: { public int compare(Object key, Object value) { String idx = Objects.toString(key); if (idx.isEmpty()) return 0; return idx != null && value != null && idx.length() > 0 && Objects.toString(((CtEntityMaster)value).getEntityCode().toUpperCase()).startsWith(idx.toUpperCase()) ? 0 : 1; } }

            MontyPan MontyPan
            mujawarv mujawarv
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: