Is it possible to use images in the new UIBinder cell rendering feature?

46 views
Skip to first unread message

Brad Leupen

unread,
Jul 16, 2012, 4:23:00 PM7/16/12
to google-we...@googlegroups.com
Hey there,

I'm experimenting with the new 2.5 UIBinder Cell Rendering functionality. So far it's working well except that i can't see a non-sprite way to use images in my template. Am i missing something?

Thanks!
Brad

Thomas Broyer

unread,
Jul 17, 2012, 2:39:53 AM7/17/12
to google-we...@googlegroups.com

On Monday, July 16, 2012 10:23:00 PM UTC+2, Brad Leupen wrote:
Hey there,

I'm experimenting with the new 2.5 UIBinder Cell Rendering functionality. So far it's working well except that i can't see a non-sprite way to use images in my template. Am i missing something?

You can use a DataResource and its getSafeUri() method, or pass the result of AbstractImagePrototype#getSafeHtml() as a <ui:with> parameter.
Example using a DataResource:

<ui:data field="img" src="myImage.png" />
<img src="{img.getSafeUri}" />

IIRC there's an open issue to make it easier to use an ImageResource in UiBinder without resorting to @sprite or externalizing the AbstractImagePrototype thingy.
Reply all
Reply to author
Forward
0 new messages