statusItem.setOperator(OperatorId.EQUALS);
statusItem.setAllowEmptyValue(true);
filterForm.setFields(commonNameItem, lifeSpanItem, statusItem);
filterForm.addItemChangedHandler(new ItemChangedHandler() {
public void onItemChanged(ItemChangedEvent event) {
tileGrid.fetchData(filterForm.getValuesAsCriteria());
}
});
vStack.addMember(filterForm);
final DynamicForm sortForm = new DynamicForm();
sortForm.setIsGroup(true);
sortForm.setGroupTitle("Sort");
sortForm.setAutoFocus(false);
sortForm.setNumCols(6);
SelectItem sortItem = new SelectItem();
sortItem.setName("sortBy");
sortItem.setTitle("Sort By");
LinkedHashMap valueMap = new LinkedHashMap();
valueMap.put("commonName", "Animal");
valueMap.put("lifeSpan", "Life Span");
valueMap.put("status", "Endangered Status");
sortItem.setValueMap(valueMap);
final CheckboxItem ascendingItem = new CheckboxItem("chkSortDir");
ascendingItem.setTitle("Ascending");
sortForm.setFields(sortItem, ascendingItem);
sortForm.addItemChangedHandler(new ItemChangedHandler() {
public void onItemChanged(ItemChangedEvent event) {
String sortVal = sortForm.getValueAsString("sortBy");
Boolean sortDir = (Boolean) ascendingItem.getValue();
if(sortDir == null) sortDir = false;
if(sortVal != null) {