yahooAttribution.setContents("<a href='http://developer.yahoo.net/about'>"
+ "<img src='http://l.yimg.com/a/i/us/nt/bdg/websrv_88_1.gif' border='0'>"
+ "</a>");
canvas.addChild(yahooAttribution);
DataSource yahooDS = new DataSource();
yahooDS.setDataURL("http://api.search.yahoo.com/ImageSearchService/V1/imageSearch");
yahooDS.setRecordXPath("/yahoo:ResultSet/yahoo:Result");
XmlNamespaces xmlNamespaces = new XmlNamespaces();
xmlNamespaces.addNamespace("yahoo", "urn:yahoo:srchmi");
yahooDS.setXmlNamespaces(xmlNamespaces);
DataSourceImageField thumbnail = new DataSourceImageField("Thumbnail", "Thumbnail");
thumbnail.setWidth(150);
thumbnail.setImageHeight("imageHeight");
thumbnail.setImageWidth("imageWidth");
thumbnail.setValueXPath("yahoo:Thumbnail/yahoo:Url");
DataSourceIntegerField imageWidth = new DataSourceIntegerField("imageWidth");
imageWidth.setValueXPath("yahoo:Thumbnail/yahoo:Width");
imageWidth.setAttribute("hidden", true);
DataSourceIntegerField imageHeight = new DataSourceIntegerField("imageHeight");
imageHeight.setValueXPath("yahoo:Thumbnail/yahoo:Height");
imageHeight.setAttribute("hidden", true);
DataSourceField title = new DataSourceField("Title", FieldType.TEXT);
DataSourceField summary = new DataSourceField("Summary", FieldType.TEXT);
DataSourceLinkField fullImage = new DataSourceLinkField("link", "Full Image");
fullImage.setValueXPath("yahoo:Url");
fullImage.setAttribute("target", "_blank");
yahooDS.addField(thumbnail);
yahooDS.addField(imageWidth);
yahooDS.addField(imageHeight);
yahooDS.addField(title);
yahooDS.addField(summary);
yahooDS.addField(fullImage);
final ListGrid grid = new ListGrid();
grid.setTop(120);
grid.setWidth100();
grid.setHeight(300);