Hi,
I use a DockLayoutPanel as the root panel for my application. It uses the
followijg CSS style:
.display
{
margin:0px;
/*# center center; */
background-color: #000000;
background-image: url(img/Background/std.jpg);
background-repeat: no-repeat;
background-position: 0px 60px;
}
Now the users should be able to disable the background image. So I deleted
the line for "background-image" above and add it dynamically, if the user
wants it:
if (userWantsBackground)
{
Style s = getElement().getStyle();
s.setBackgroundImage("img/Background/std.jpg");
}
However, this statement has no effect. No background is shown. When using
"inspect element" in chrome, there is no property "background-image".
But I am sure that this code is called (verified with Window.alert).
Questions:
- How can I add the property "background-image" to an existing style?
- What about the image itself? Will it be loaded automatically, when I set
the style?
Thanks a lot!
Magnus
--
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/-/AjWHD-xdQIEJ.
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.