Friday, June 17, 2011

Re: How can I create a celltable of images?

Alright.

private static class ColorCell extends ImageCell {


@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
String value, SafeHtmlBuilder sb) {

// Always do a null check on the value. Cell widgets can pass null
to cells
// if the underlying data contains a null, or if the data
arrives out of order.
if (value == null) {
return;
}

// If the value comes from the user, we escape it to avoid XSS
attacks.
SafeHtml safeValue = SafeHtmlUtils.fromString(value);

// Append some HTML that sets the text color.
sb.appendHtmlConstant("<div><img src=\"" + safeValue.asString()
+ "\" width=100 height=100>");
sb.appendHtmlConstant("</div>");
}
}

On Jun 18, 2:01 am, dadada <ytbr...@gmail.com> wrote:
> Hi,
>
> can someone please show me the easy way of creating a celltable of
> images? Not imageresource.
>
> Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate