Bayard Randel
unread,Sep 26, 2010, 6:17:39 PM9/26/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I certainly know how you feel - I'd love to see some documentation for
2.1 as well. I'm sure the gwt team is diligently working on it as we
speak.
Here's some code that I just wrote, that hopefully will help. I'm
passing my ListDataProvider from my presenter into my view.. I'm still
uncertain if this is the best approach.
Presenter
---------
private void updateTable(List<Listing> result) {
ListDataProvider<Listing> listingDataProvider = new
ListDataProvider<Listing>(result);
getView().renderListingTable(listingDataProvider);
}
View
-----
public void renderListingTable(ListDataProvider<Listing> provider) {
CellTable<Listing> ListingCellTable = new CellTable<Listing>();
ListingPanel.add(ListingCellTable);
ListingCellTable.setTitle("Current Listings");
ListingCellTable.setHeight("300px");
Column<Listing, String> nameColumn =
new Column<Listing, String>(new TextCell()) {
@Override
public String getValue(Listing object) {
return object.getItemName();
}
};
Column<Listing, String> ListingStatusColumn =
new Column<Listing, String>(new TextCell()) {
@Override
public String getValue(Listing object) {
return object.getStatus().toString();
}
};
ListingCellTable.addColumn(nameColumn, "Listing");
ListingCellTable.addColumn(ListingStatusColumn, "Status");
provider.addDataDisplay(ListingCellTable);
}