When i added DataSourceImageField, the grid stopped displaying anything. It just shows “Loading data…”. What does that mean?
All of my url’s are returning fine directly in the browser.
RestDataSource imageAlbumDS = new RestDataSource();
DataSourceIntegerField idField = new DataSourceIntegerField("id", "ID");
idField.setPrimaryKey(true);
DataSourceTextField nameField = new DataSourceTextField("name", "Name");
DataSourceTextField descriptionField = new DataSourceTextField("description", "Description");
DataSourceDateField postedGMTField = new DataSourceDateField("postedGMT", "Posted");
DataSourceIntegerField blobIdField = new DataSourceIntegerField("blobID", "Blob ID");
DataSourceImageField thumbnail = new DataSourceImageField("url", "Thumbnail");
thumbnail.setWidth(150);
thumbnail.setImageHeight("imageHeight");
thumbnail.setImageWidth("imageWidth");
thumbnail.setValueXPath("url");
imageAlbumDS.setFields(idField, nameField, descriptionField, postedGMTField, blobIdField, thumbnail);
imageAlbumDS.setFetchDataURL("../albumImageList.do?imageAlbumId=37&responseStyle=xml");
final ListGrid countryGrid = new ListGrid();
countryGrid.setWidth(500);
countryGrid.setHeight(224);
countryGrid.setAlternateRecordStyles(true);
countryGrid.setDataSource(imageAlbumDS);
countryGrid.setEmptyCellValue("--");
ListGridField idGridField = new ListGridField("id");
countryGrid.setSortField(0);
countryGrid.setDataPageSize(50);
countryGrid.setAutoFetchData(true);
RootPanel.get("pmEditSlot").add(countryGrid);
Response from ../albumImageList.do?imageAlbumId=37&responseStyle=xml
<response>
<status>0</status>
<startRow>0</startRow>
<endRow>1</endRow>
<totalRows>1</totalRows>
<data>
<record>
<id>4</id>
<name></name>
<description></description>
<postedGMT>2009-01-19 19:54:02.0</postedGMT>
<blobID>4</blobID>
<url>http://localhost:8880/company/imageServe.do?id=4&thumbnail=false</url>
</record>
</data>
</response>