Tuesday, April 30, 2013

Re: Image widget not attached?

There is only a passing mention of "ui:image" in https://developers.google.com/web-toolkit/doc/latest/DevGuideUiBinder; it and "ui:data" are called "resource elements." (Is there some place where I can find a list of and specification of the elements in the "ui" namespace?)  In your
<ui:image field='logo' src='gwt-logo.png'/>
what is the effect of the "ui:"; i.e., how is it different from an HTML <image...> element?  What I am trying to do is display an image of which the source (the URL) is not known until runtime. The image will occupy the entire browser window (the HTMLPanel root of my template); it will  be larger than the browser window/ and thus I want to use the Image widget's clipping feature.

On Tuesday, April 30, 2013 8:16:26 AM UTC-7, Thad wrote:
I don't think I've tried gwt-Image, but I have used <ui:image> and an @sprite in CSS. See https://code.google.com/p/google-web-toolkit/source/browse/releases/2.5/samples/mail/src/com/google/gwt/sample/mail/client/AboutDialog.ui.xml and other files in sample/Mail

On Tuesday, April 30, 2013 6:02:03 AM UTC-4, brec wrote:
UiBinder template extract:
         <div ui:field='myView' style='position:absolute; top:0; bot:0; left:0; right:0;' class='{style.hidden}'>
             <g:Image ui:field="myImage"/>
             <g:Button ui:field='closeButton' addStyleNames='{style.close-button}'>
                 <ui:text from='{strings.close}'/>
             </g:Button>
         </div>

The div's container is the HTMLPanel at the root of the template.

    @UiField Image      myImage;
    ...
    myImage.setUrlAndVisibleRect(url, 0, 0, width, height);

By debugger inspection I see that at the point at which setUrl... is to be called, the Image has attached: false. What am I overlooking? (This is my first use of gwt-Image.)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment