I asked a question a day ago in regards to and image of an asterisk that I want to place next to a label with text. The image however is displayed twice and I am still struggling to come to grips with this as I am still learning UiBinder and Gwt.
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:style type="com.equillore.mcmexternal.client.ui.IndicatorLabel.Style">
@sprite .mySpriteClass {gwt-image: "imageAccessor"; other: property;}
.required
{
gwt-image: 'requiredImage';
width: 7px;
height: 14px;
}
.labRequired
{
color:#303030;
font-family: Tahoma, Geneva, sans-serif;
font-size:10pt;
font-style:normal;
font-weight:lighter;
}
</ui:style>
<g:SimplePanel width='90px' 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>
If I remove the following line
<ui:image field="requiredImage" src="images/required_indicator.gif"/>
How can I make changes in my java file so that the image of the asterisk will be displayed correctly This is the java file.
public class IndicatorLabel extends Composite implements HasText {
public interface Binder extends UiBinder<Widget, IndicatorLabel> {
}
private static final Binder binder = GWT.create(Binder.class);
public interface Style extends CssResource {
String required();
}
@UiField Style style;
@UiField Label label;
public IndicatorLabel() {
initWidget(binder.createAndBindUi(this));
}
public IndicatorLabel(String text) {
this();
setText(text);
}
Kind regards