Anyway...
Using the tip from the issues list (set URL in deferred command) I can
get reliable execution of LoadListener on IE, as well as Safari and
FF.
Now I have a different problem.
In IE it seems that an image has dimensions 0 x 0 until visible, even
if it is loaded. Is there any way around that?
Here is my test program. On Safari and FF I get size 120,90 for the
image, even before it is made visible. In IE size is 0,0 until made
visible.
final RootPanel rootPanel = RootPanel.get("jobList");
final String url =
"http://arstechnica.com/mt-static/plugins/ArsTheme/style/themes/
light/images/logo.png";
final Image image = new Image();
final Label l = new Label("Not loaded yet, size " + image.getWidth
() + ", " + image.getHeight());
rootPanel.add(l);
image.setVisible(false);
LoadListener ll = new LoadListener() {
public void onError(Widget sender) {
l.setText("Failed");
}
public void onLoad(Widget sender) {
l.setText("Success, size " + image.getWidth() + ", " +
image.getHeight());
rootPanel.add(new Button("Make visible", new
ClickListener() {
public void onClick(Widget sender) {
image.setVisible(true);
l.setText("Visible, size " +
image.getWidth() + ", " +
image.getHeight());
}}));
}
};
image.addLoadListener(ll);
rootPanel.add(image);
DeferredCommand.addCommand(new Command(){
public void execute() {
image.setUrl(url);
}
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---