# Group sorting and GroupsModelExt.group

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.


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 retag edit

jumperchen
3909 2 8
http://jumperchen.blogspo...

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.

[hide preview]