0

Group sorting and GroupsModelExt.group

asked 2009-09-02 17:25:05 +0800

cvarona gravatar image cvarona
554 1 6

Hi,

I'm currently working on a GroupsModel/GroupsModelExt implementation in order to display our custom data models into zk listboxes and taking advantage of the grouping feature.

After implementing GroupsModelExt.sort I've run into difficulties with GroupsModelExt.group.

To start with, the javadoc is rather obscure as far as this method is concerned:

group

void group(java.util.Comparator cmpr,
           boolean ascending,
           int colIndex)

    Groups and sorts the data by the specified column. It only called when Listbox or Grid has the sort function. 

After looking into the ArrayGroupsModel source code I've (possibly wrong) deduced GroupsModelExt.group is meant to sort the groups. However, it seems not to ever be invoked, or at least that what I've experienced after setting up a breakpoint within.

So I'd like to know:

1) What does "a listbox or grid has the sort function" mean?
2) When gets GroupModelExt.group invoked?
3) The sorting arrows only seem to trigger GroupsModelExt.sort. How can I trigger a GroupsModelExt.group? Should I set up a special component (e.g. a button) to perform that sorting?
4) How do GroupComparators fit into the whole vista?

If somebody could provide the answers to some of these questions I'd be most grateful

César Varona

delete flag offensive retag edit

1 Reply

Sort by » oldest newest

answered 2009-10-21 21:39:19 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

1. The sort function in a group means it will sort the data in the same group.
2. The GroupModelExt.group is invoked when user click the group function or developer calls the column#group() method.
3. The same as the second question.
4. You need to implement your own GroupsModel and GroupsModelExt to compare the data.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-09-02 17:25:05 +0800

Seen: 196 times

Last updated: Oct 21 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More