On 2 oct, 13:07, Art <art...@gmail.com> wrote:
> Hello,
>
> I have the image created by the image bundle like next:
>     AbstractImagePrototype jpNationFlagImagePrototype =
> bounceAbsorberImageBundle.jpNationFlag();
> I wrapped that by the Anchor widget like:
>     Anchor jpAnchor = new Anchor( jpNationFlagImagePrototype.getHTML
> (), true, hrefStr + "locale=ja_JP");
>
> In the hosted mode or on IE7 (web mode), clicking on that Anchor
> widget does nothing.

See http://code.google.com/p/google-web-toolkit/issues/detail?id=3080
It's been reported nearly a year ago, but unfortunately it's hard to
fix. The proposed fix is to completely rework ImageBundle (and the
@sprite equivalent in CssResource):
http://code.google.com/p/google-web-toolkit/issues/detail?id=3588
(the actual underlying issue is that in IE, the click event is "eaten"
by the image and doesn't propagate up to the anchor:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3951 )

The workaround is to use an Image with a ClickHandler and
Window.Location.assign(...), or to not use an ImageBundle (use an
image on its own)

> On FF 3.5 (web mode), clicking on that Anchor widget works as
> expected: forwarding to the URL specified as the part of hrefStr +
> "locale=ja_JP" above.
>
> I see the differences in the permutation results for IE and FF. For
> IE, img HTML tag has been wrapped by clipper tag like:
>     <gwt:clipper style="overflow: hidden; width: 16px; height: 11px;
> padding: 0px; zoom: 1"><img src='http://' onerror='if
> (window.__gwt_transparentImgHandler)window.__gwt_transparentImgHandler
> (this);else this.src="http://localhost:8080/bounceabsorber/
> clear.cache.gif"' style="filter:
> progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://
> localhost:8080/bounceabsorber/
> CD45E40E45B278324279E1892614A969.cache.png',sizingMethod='crop');
> margin-left: 0px; margin-top: 0px; border: none" width=16 height=11
> border='0'></gwt:clipper>
>
> When I intentionally extracted the img HTML tag and added the
> extracted img HTML tag to the Anchor widget like below, the problem
> went away: clicking on the Anchor widget worked to forward to the
> intended URL as expected in the hosted mode or on IE7 (web mode).
>     Element imgElement = jpNationFlagImagePrototype.createElement
> ().getElementsByTagName( "img").getItem( 0);
>     Anchor jpAnchor = new Anchor();
>     jpAnchor.getElement().appendChild( imgElement);
>     jpAnchor.setHref( hrefStr + "locale=ja_JP");
>
> I like to know if there will be any draw back for removing clipper tag
> by the above way, in order to clicking on Anchor widget works on IE.

Well, AFAICT, it'll only display as expected if your image is in the
upper left corner of the generated bundle.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to