I'm creating a popup panel in GWT to display a loading CSS animation while a RPC operation is running. To do this, I've created a popup panel using a uiBinder element. Thus, everything is working fine, but I don't know how to get rid of a white frame that "surrounds" my popup panel. Let me show you this:
What I want to achieve this:
Ok, let me show you the code from my popup panel...
public class LoadingDialogMessage extends PopupPanel {
private static LoadingDialogMessageUiBinder uiBinder = GWT.create(LoadingDialogMessageUiBinder.class);
interface LoadingDialogMessageUiBinder extends UiBinder<Widget, LoadingDialogMessage> {}
public LoadingDialogMessage() {
setWidget(uiBinder.createAndBindUi(this));
setAutoHideEnabled(true);
setGlassEnabled(true);
center();
}
}
Here is the code from my ui.xml file:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<g:HTMLPanel styleName="loading_container">
<label class="loading_label">Loading info from itsaseus buoys</label>
<div class="bubblingG">
<span id="bubblingG_1">
</span>
<span id="bubblingG_2">
</span>
<span id="bubblingG_3">
</span>
</div>
</g:HTMLPanel>
</ui:UiBinder>
The CSS associated:
.loading_label{
color:#ffffff;
font-size: 85%;
text-align: center;
text-decoration: none;
/* font-stretch: condensed; */
font-weight: bold;
font-family: Helvetica, Arial, sans-serif;
}
.loading_container{
height: 100%;
background: #3a9bff;
padding: 0.5em;
text-align: center;
border:3px solid;
border-color: #4452ED;
/* border-radius */
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
/* box-shadow */
-webkit-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
-moz-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
}
The rest of CSS are automatically generated for the loading animation from this page. I don't think they have nothing to do with it because if I remove the divs that use those style the problem is still there..
Anybody know how to get rid of this white frame? I'm not good at all with CSS and this is so weird...I tried lots of tweaks, but none worked...
Thanks! Alex
EDIT: As suggested, I've created a new class in my main css file:
.loading_panel{
border: none;
background: transparent;
}
Modified the ui.xml:
<g:HTMLPanel>
<div class="loading_container">
<label class="loading_label">Loading info from itsaseus buoys</label>
<div class="bubblingG">
<span id="bubblingG_1">
</span>
<span id="bubblingG_2">
</span>
<span id="bubblingG_3">
</span>
</div>
</div>
</g:HTMLPanel>
And I'm associating the style when I create the popup:
m = new LoadingDialogMessage();
m.addStyleName("loading_panel");
m.show();
And this is the generated HTML code:
<div class="gwt-PopupPanel loading_panel" style="left: 649px; top: 444px; visibility: visible; position: absolute; overflow: visible;">
<div class="popupContent"><div>
<div class="loading_container">
<label class="loading_label">Loading info from itsaseus buoys</label>
<div class="bubblingG">
<span id="bubblingG_1"> </span>
<span id="bubblingG_2"> </span>
<span id="bubblingG_3"> </span>
</div>
</div>
</div>
</div>
</div>
While the loading_panel style is added, GWT is adding the gwt-PopupPanel style and also this:
style="left: 649px; top: 444px; visibility: visible; position: absolute; overflow: visible;"
Looks like addStyleName is not overriding at all...