I have a trouble with loading images under IE browser. Sources for
images are existent and images are valid, but IE shows only empty
squares with colored figures.
I've intalled ID dev toolbar and drill down into HTML code generated
by GWT js.
Here is what I've seen in code:
<IMG class="gwt-Image" __eventBits="229501" __widgetID="6"
__pendingSrc="http://xxx.png" />
Searching across the google gave me nothing in topic of
"__pendingSrc".
But! When I manully added "src" attribute to <IMG> tag I received:
<IMG class="gwt-Image" src="http://xxx.png" __eventBits="229501"
__widgetID="10" __pendingSrc="http://xxx.png" /> and images correctly
shows on screen.
In Java-GWT code I use only Image widget.
Could pleaswe anyone say what going on here?
Specifically,
if you create 10 image objects, all pointing to the same image, the
proper behaviour for the browser is to download this image ONCE.
IE downloads it 10 times. This is, in a word, BAD.
GWT works around it by not actually initializing images (=setting up
the .src property) until any other images with the same url have
completed loading. (IE will grab an image from cache if it has been
fully loaded already).
GWT keeps track of the src it's trying to become with __pendingSrc.
If you're having trouble loading the image you appear to be doing
something strange. Possibly the first load somehow gets an error
message, but subsequent loads don't. At any rate, your bug is
elsewhere.
I have had the same problem with loading Images in my code. Try
searching the forums or issue tracker for "__targetSrc", as this is
the name of the attribute set by my environment. I moved on by
creating a wrapper method for Image that uses .setURL(path) and
DOM.setElementAttribute(Image.getElement(), "src", path); Based on my
experience with the ImageBundle implementation, I wouldn't go hunting
around your code for a bug thats causing this behavior. Good luck
Dav