Element may only contain a single child element, but found <inherits name='com.google.gwt.resources.Resources'> and <g:SimplePanel height='21px' width='120px'>. Element <ui:UiBinder> (:3)

475 views
Skip to first unread message

arian

unread,
Jun 9, 2012, 7:46:35 AM6/9/12
to Google Web Toolkit
Hi there

I am trying to add an image as a managed resource but am experiencing
some difficult and get the error contained in the subject.

This is mu 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">
<ui:style type =
"com.equillore.mcmexternal.client.ui.IndicatorLabel.Style">

<inherits name="com.google.gwt.resources.Resources" />
@sprite

.required
{

gwt-image: 'requiredImage';
font-weight:bold;
width: 7px;
height: 14px;
}
.labRequired
{

color:#2E2E2E;
font-family: Tahoma, Geneva, sans-serif;
font-size:8pt;
font-style:normal;
font-weight:bold;
}
</ui:style>


<g:SimplePanel width='120px' height='21px'>
<g:Grid>
<g:row>
<g:customCell>
<g:Label ui:field="label"
addStyleNames="{style.labRequired}"/>
</g:customCell>
<!-- <g:customCell>
<g:Label addStyleNames="{style.required}"/>
</g:customCell> -->
</g:row>
</g:Grid>
</g:SimplePanel>


</ui:UiBinder>

and in my java file I added the following code

public interface myResources extends ClientBundle{
@Source ("images/required_indicator.gif")
ImageResource requiredImage();

}

My objective is to add this image to the grid. Is this the right why
to go about it. ?

Thomas Broyer

unread,
Jun 9, 2012, 11:41:13 AM6/9/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages