After taking a step back and looking again, naturally, super.layout()
call was missing.
Cheers.
On 2/23/11, Matej Jelovcan <zuticar@gmail.com> wrote:
> Hey guys. Simple problem. I'll just post the source...
>
> public class ImageWindow extends Window
> {
> private Image image = null;
>
> public ImageWindow()
> {
> this.setHeading("Original Heading");
> image = new Image(Images.INSTANCE.loading());
> this.add(image);
> }
>
> public void setImage(FileNode file)
> {
> final ZPortalServiceAsync portalService =
> Registry.get(Statics.PORTAL_SERVICE);
> portalService.getImage(file, ImageDisplayMode.Preview, new
> AsyncCallback<FileNode>()
> {
> @Override
> public void onSuccess(FileNode result)
> {
> ImageWindow.this.remove(image);//it removes it
> image = new Image(result.getData());
> ImageWindow.this.add(image );//nothing
> ImageWindow.this.setSize(result.getWidth(),
> result.getHeight());//resize is OK, data is received
> ImageWindow.this.setHeading("Async Heading");//heading is changed
> }
>
> @Override
> public void onFailure(Throwable caught)
> {
> ImageWindow.this.setHeading("Error Heading");
> }
> });
> }
> }
>
> If you can notice, I create my ImageWindow with loading image
> (animated gif...). Then I call setImage() procedure with parameter
> (called from outside, where ImageWindow is created). Now, after image
> data is retrieved I would like to replace original loading gif with
> it. Not working. Header is set, window is resized to new image
> dimensions but no image is displayed.
>
> I must be missing somethig really obvious I guess :S
>
> Thanks.
>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment