> idont want to use GQuery because it generates heavy javascript.
Indeed, GQuery produces extra javascript code when you use the CSS
class (and only if you use it) due to the static initializer of this
class. We are aware of this problem. An issue exists to track it and
should be resolved soon :
http://code.google.com/p/gwtquery/issues/detail?id=107

By waiting that this issue is fixed you can use the following workaround :

$("#topbar").css("backgroundImage",
UriValue.url(HomePageClientBundle.INSTANCE.topbar2().getSafeUri().asString())..getCssName());


Julien

On Tue, Nov 22, 2011 at 8:25 PM, Deepak Singh <[email protected]> wrote:
> Tried this also. But still image is not displayed.
> If i use GQuery and does this one
> $("#topbar").css(CSS.BACKGROUND_IMAGE.with(UriValue.url(HomePageClientBundle.INSTANCE.topbar2().getSafeUri().asString())));
>
> then image gets displayed.
> But using gwt
> Document.get().getElementById("topbar").getStyle().
> setBackgroundImage(HomePageClientBundle.INSTANCE.topbar2().getSafeUri().asString());
> does not display the image.
> idont want to use GQuery because it generates heavy javascript.
> Thanks
> Deepak
>
>
> On Wed, Nov 23, 2011 at 12:44 AM, Andrea Boscolo <[email protected]>
> wrote:
>>
>> Should be ImageResource yes, and I also think the setBackgroundImage(...)
>> method accepts a String, not an ImageResource.
>>
>> In the 2.4 release you should use
>>
>> ...setBackgroundImage(clientbundle.topbar2().getSafeUri().asString());
>> cause in 2.4 the getUrl() in the ImageResource is deprecated.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/google-web-toolkit/-/-NpRnD2DgMAJ.
>> 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.
>
>
>
> --
> Deepak Singh
>
> --
> You received this message because you are subscribed to the Google Groups
> "gwtquery" 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/gwtquery?hl=en.
>

-- 
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.

Reply via email to