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

Let BindingListModelListModel implement Sortable

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Databind, Databind 2
    • ZK Version: 6.5.1.1 Build: 2012121311

      I have the following situation:

      • A listbox with data taken from a model
      • All listheaders have comparators set for each direction (using setSortAscending/setSortDescending)
      • The listbox should allow multiple selection

      I was previously (i.e., ZK <= 5.0.8) using a ListModelList in my composer. I kept using it, calling setMultiple(true) on it, until I found out that the the sorting was broken. This is because the listbox doesn't see the original ListModelList , but a BindingListModelListModel, which doesn't implement Sortable, even when the model retrieved by getInnerModel() does. Thus, I was getting a message of the sort of "Sortable must be implemented by BindingListModelListModel" or so.

      I suggest that either:
      a) BindingListModelListModel supports Sortable, throwing a runtime exception when sort() or getSortDirection() are called on an inner model that doesn't implement Sortable.
      b) Listbox/grid treat BindingListModelListModel apart, checking if the inner model supports Sortable.

      I anyways bypassed the problem by offering a BindingListModelList directly from my composer.

            Unassigned Unassigned
            rtobar rtobar
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: