Clearing a list

3 views
Skip to first unread message

zorro2b

unread,
Jul 16, 2010, 2:36:32 AM7/16/10
to GWT Pectin
I have just started using pectin and particularly need to deal with
lists. I have "Apply" and "Reset" buttons associated with the list.
Reset removes all entries from the list.

To implement this I have added a method to my form model:

protected final ListFieldModel<String> trainSetFilters;
...
public void clearTrainSetFilters() {
try {
String v = null;

do {
v = trainSetFilters.get(0);
trainSetFilters.remove(v);
} while (v != null);
} catch (Exception e) {
// out of bounds exception when done
}
}

This seems quite an ugly way to do it. It would be nice to have a
clear method in ListFieldModel.

Alternatively is there a better way to do this?

Andrew Pietsch

unread,
Jul 16, 2010, 3:19:26 AM7/16/10
to gwt-pecti...@googlegroups.com
Howdy,

A clear() method is in version 0.8.

Cheers
Andrew
Reply all
Reply to author
Forward
0 new messages