trying to add an image as a managed resource

21 views
Skip to first unread message

arian

unread,
Jun 9, 2012, 8:22:23 AM6/9/12
to Google Web Toolkit
Hi there
I am customizing a label and placed the name of the label in the one
cell of a grid and an asterisk(image) in the next cell.


<ui:image field="requiredImage" src="images/required_indicator.gif"/>
<ui:style
type="com.equillore.mcmexternal.client.ui.IndicatorLabel.Style">
@sprite
.requiredImage
{
gwt-image: 'requiredImage';
width: 7px;
height: 14px;
}
.labRequired
{
color:#B22222;
font-size:14;
font-style:normal;
font-weight:bold;
font-family: serif;
letter-spacing: 0.07em;
}
</ui:style>
<g:Grid >
<g:row>
<g:customCell>
<g:Label ui:field="label"
addStyleNames="{style.labRequired}"/>
</g:customCell>
<g:customCell>
<g:Label addStyleNames="{style.requiredAsterisk}"/>
</g:customCell>
</g:row>
</g:Grid>

when I run this the asterisk image is however displayed in front of
the label(labRequired) as well just after it. So it is displayed
twice.

In my understanding it is better to add this image as a managed
resource.

How can I do this?

Joseph Lust

unread,
Jun 10, 2012, 4:37:37 PM6/10/12
to google-we...@googlegroups.com
Sounds like the image is being repeated as a background on your label element.

Try to added the RepeatStyle value to the @ImageOptions annotation in your ImageResource bundle on that image method:
@ImageOptions(repeatStyle = RepeatStyle.None) 


Joe
Reply all
Reply to author
Forward
0 new messages