Based on the following resources:
http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html
Use ClientBundle image as background-image
I have successfully implemented a GWT <g:Image>
image resource in a UIBinder template:
<ui:with field='res' type='com._.client.resources.Resources'></ui:with>
<g:Image resource="{res.menuLogo}" altText="" styleName="{style.menuLogo}"/>
However, I am trying to add an image as a child element of a <g:MenuItem>
, which in GWT can only have pure HTML elements as children:
<g:MenuItem>
<img id="revealIcon" src="images/trianglebuttonWHITE-DOWN.png" width="11"/>
</g:MenuItem>
The image is for a small widget that will change when the sub-menu is active.
My goal is to handle all resources through a ClientBundle and avoid having any in the WAR directory.
Can I reference a ClientBundle resource for a pure HTML <img>
image?
Should I do this programmatically and/or with CSS Image Sprites instead?