Tuesday, April 30, 2013

Re: Image widget not attached?

I removed the g:Image element from the UiBinder template and tried creating it in code, thus:

Image myImage;
...
myImage = new Image(url, 0, 0, width, height);
myHTMLPanel.add(myImage, myView);
 
This does not generate access to the URL (per FireBug, no network activity is generated). And I can find no evidence that the .add() did anything. What should I do to cause the image to be fetched from the URL and the Image widget to be attached to the desired div element?
 
On Tuesday, April 30, 2013 3:02:03 AM UTC-7, 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