Question

This image is showing but I can't resize it not matter the width or height values I use. Any thougt? Thankyou.

<ui:with field='res' type='com.hellomvp.client.resources.MyResources'/>

    <ui:style>
        .fortaImage { width:'50px'; height:'50px';} 
    </ui:style>

    <g:DockLayoutPanel unit='EM'>
        <g:north size="10"> 
            <g:FlowPanel>
            <g:Image styleName='{style.fortaImage}' resource='{res.fortaLogo}'/>
            <g:InlineLabel>FortaService</g:InlineLabel>
            <g:ListBox></g:ListBox>
            <g:InlineLabel>DateIn</g:InlineLabel>
            <d:DateBox></d:DateBox>
            <g:InlineLabel>DateOut</g:InlineLabel>
            <d:DateBox></d:DateBox>
            <g:Button>Cerca</g:Button>

            </g:FlowPanel>
        </g:north>



    </g:DockLayoutPanel>
Was it helpful?

Solution

When you use <g:Image resource="..."/>, GWT uses a background image. Background images cannot be resized in CSS 2.1. (I really wish it was possible!)

All you can do is either have a 50x50px version of the image on the server, or use <g:Image url="..."/> instead. This creates a normal <img src="..."/> instead of the background image, but you can't specify a ClientBundle resource here.

OTHER TIPS

addStyleNames="{style.fortaImage}"

not

styleName='{style.fortaImage}'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top