The other solution which seems to work is that I can put
@sprite .header {
gwt-image: 'myimage';
}
in a css file and reference it as a CssResource in a ClientBundle...then it
will look for an image resource called 'myimage' in that ClientBundle.
it works but it just puts stuff in to the css file associated with my global
theme that I would rather just keep local to my widget.
Dave
On Thu, Jun 10, 2010 at 9:41 AM, David Grant <[email protected]> wrote:
> Has anyone succeeded in using @sprite <selector> {gwt-image: ...} in a
> uibinder file to access an image in a ClientBundle?
>
> I've tried the following which Chris Ramsdale at Google claimed would
> work<http://groups.google.com/group/google-web-toolkit/browse_thread/thread/ed48cc0ddde4b52f>but
> it doesn't:
>
> <ui:with field="theme" type="com.companyname.resources.ThemeManager" />
> <ui:image field="myimage" resource="{theme.res.globalrelaylogounity}"/>
> <ui:style>
> @sprite .header {
> gwt-image: 'myimage';
> }
> </ui:style>
>
> I can't use <ui:image src=""> because I definitely can't put a hard-coded
> path there because it needs change if the user changes themes. I'm grabbing
> the ClientBundle from ThemeManager.res(). We need to be able to switch
> themes, which involves switching the ClientBundle being used. I've tried
> putting an expression in src= using curly braces to get the path dynamically
> but that doesn't work.
>
> The only alternative I can think of is to layout the UI in java code which
> sucks.
>
> Dave
>
--
David Grant
http://www.davidgrant.ca
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.