GWT UiBinder doesn't load the stylesheet
Posted
by halish
on Stack Overflow
See other posts from Stack Overflow
or by halish
Published on 2010-03-12T11:07:26Z
Indexed on
2010/03/12
12:27 UTC
Read the original article
Hit count: 587
I wanted to make a GWT widget using UiBinder. So I made:
UserPanel.ui.xml like this:
<?xml version="1.0" encoding="UTF-8"?>
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<ui:with field="res" type="com.example.resources.UserPanelResources" />
<g:VerticalPanel styleNames='{res.userpanel.main}'>
...some other widgets go here...
</g:VerticalPanel>
</ui:UiBinder>
UserPanel.css like this:
.main {
width: 1000px;
background-color: #f9f9fa;
padding: 15px 10px;
font-family: "Georgia";
}
and UserPanelResources.java like:
public interface UserPanelResources extends ClientBundle {
public interface UserPanelCss extends CssResource {
String main();
}
@Source("css/userpanel.css")
UserPanelCss userpanel();
}
All the files and packages are in their place, as everything compiles just fine. But when I run the Development Mode, the styles are not applied! I tried many different approaches, but it still doesn't work.
What I noticed, is that in the HTML, the VerticalPanel is given the class name obfuscated by GWT, but the CSS is not send to the browser - in fact, the GWT doesn't even ask for it.
Am I missing something?
© Stack Overflow or respective owner