tileGrid.setShowAllRecords(true);
tileGrid.setDataSource(AnimalXmlDS.getInstance());
tileGrid.setAutoFetchData(true);
tileGrid.setAnimateTileChange(true);
DetailViewerField pictureField = new DetailViewerField("picture");
DetailViewerField commonNameField = new DetailViewerField("commonName");
commonNameField.setCellStyle("commonName");
DetailViewerField lifeSpanField = new DetailViewerField("lifeSpan");
lifeSpanField.setCellStyle("lifeSpan");
lifeSpanField.setDetailFormatter(new DetailFormatter() {
public String format(Object value, Record record, DetailViewerField field) {
return "Lifespan: " + value;
}
});
DetailViewerField statusField = new DetailViewerField("status");
statusField.setCellStyleHandler(new CellStyleHandler() {
public String execute(Object value, DetailViewerField field, Record record) {
if("Endangered".equals(value)) {
return "endangered";
} else if ("Threatened".equals(value)) {
return "threatened";