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

Chosenbox - Combobox behaving differently (when using ListSubModel)

    Details

      Description

      attached example uses the same ListModel with ListSubModel for a Chosenbox and a Combobox

      when the method getSubModel is called, the value of parameter nRows is inconsistent between both components
      for combobox -1 is passed
      for chosenbox 50000 is passed

      in any case the value can be ignored (as it is not required for these components) but should be consistent (I'd suggest -1 as it is meaningless anyway)

        Activity

        Hide
        jumperchen jumperchen added a comment -

        Fixed since 7/31/2013.
        Make the both values in consistent with -1 by default.

        Show
        jumperchen jumperchen added a comment - Fixed since 7/31/2013. Make the both values in consistent with -1 by default.
        Hide
        daquan198163 daquan198163 added a comment -

        I tried to filter the model data with full text matching,and the logs show that CustomerSortComparator works correctly,
        but the chosenbox drop down with empty list.

        But if the input value matches the data at the beginning,it will appear in the chosenbox drop down list,
        just like the CustomerSortComparator was invoked and ignored!

        ListModels.toListSubModel(new ListModelList<String>(dataList, false),new CustomerSortComparator(), 100);

        CustomerSortComparator.java
        public class CustomerSortComparator implements Comparator<String> {
        		@Override
        		public int compare(String paramT1, String paramT2) {
        			if (StringUtils.isEmpty(paramT1)) {
        				logger.debug("empty not matching " + paramT2);
        				return -1;
        			}
        			boolean matching = paramT2.indexOf(paramT1) >= 0;
        			if (matching) {
        				logger.debug("compare[" + paramT1 + "|" + paramT2 + "]matching");
        				return 0;
        			} else {
        				return -1;
        			}
        		}
        
        	}
        
        Show
        daquan198163 daquan198163 added a comment - I tried to filter the model data with full text matching,and the logs show that CustomerSortComparator works correctly, but the chosenbox drop down with empty list. But if the input value matches the data at the beginning,it will appear in the chosenbox drop down list, just like the CustomerSortComparator was invoked and ignored! ListModels.toListSubModel(new ListModelList<String>(dataList, false),new CustomerSortComparator(), 100); CustomerSortComparator.java public class CustomerSortComparator implements Comparator< String > { @Override public int compare( String paramT1, String paramT2) { if (StringUtils.isEmpty(paramT1)) { logger.debug( "empty not matching " + paramT2); return -1; } boolean matching = paramT2.indexOf(paramT1) >= 0; if (matching) { logger.debug( "compare[" + paramT1 + "|" + paramT2 + "]matching" ); return 0; } else { return -1; } } }

          People

          • Assignee:
            jumperchen jumperchen
            Reporter:
            cor3000 cor3000
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: