Background at runtime

Hi!

The images I keep in the database. Depending on conditions, I take out the necessary image. No problem. After I want to make it the background for AbsoluteLayout at runtime. How can I best implement it?

Thank you!

Hi Andris,

Take a look at this forum thread, similar problem and a solution:
how to dynamically skin a widget via css

Jouni, thanks for your reply!

Could you give an example how to use CSSInject to change the background image in AbsoluteLayout?

Thanks!

Another workaround:


AbsoluteLayout al;
...
al.setDebugId("dashboard");
...
mainWindow.executeJavaScript("document.getElementById('dashboard').style.backgroundImage = \"url('http://localhost:8084/MyApp/VAADIN/themes/MyApp/images/document.jpg')\";");

However, very interesting how to use CCSInject to achieve the same effect?

Thanks!