ImageResource bug in IE7

2010-01-08 Thread Thad
I have a Tree whose TreeItems I originally created according to the
Mail sample way back under GWT 1.2:

  private String imageItemHTML(String imageUrl, String title) {
return spanimg style='margin-right:4px' src=' +
imageUrl.toLowerCase()
+ ' + title + /span;
  }

This approach allows for highlighting of the entire TreeItem, and
transitioned easily to ImageBundles:

  private String createHeaderHTML(AbstractImagePrototype imageProto,
String caption) {
return span style='white-space:nowrap' + imageProto.getHTML()
+
caption + /span;
  }

Along comes GWT 2 and the ImageResource.  No problem (or so I think):

  private String createHeaderHTML(ImageResource imageRsrc, String
caption) {
return span style='white-space:nowrap'img src=' +
imageRsrc.getURL()
+ ' + caption + /span;
  }

All well and good in Firefox and Safari, but not in IE.  In IE (I'me
testing with IE7) I get the **entire** image bundle of some dozen
16x16 icons.

How can I get the same effect--one image--without creating them
individually?
-- 
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-tool...@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.




Re: ImageResource bug in IE7

2010-01-08 Thread Thomas Broyer


On Jan 8, 5:03 pm, Thad thad.humphr...@gmail.com wrote:
 I have a Tree whose TreeItems I originally created according to the
 Mail sample way back under GWT 1.2:

   private String imageItemHTML(String imageUrl, String title) {
     return spanimg style='margin-right:4px' src=' +
 imageUrl.toLowerCase()
         + ' + title + /span;
   }

 This approach allows for highlighting of the entire TreeItem, and
 transitioned easily to ImageBundles:

   private String createHeaderHTML(AbstractImagePrototype imageProto,
         String caption) {
     return span style='white-space:nowrap' + imageProto.getHTML()
 +
         caption + /span;
   }

 Along comes GWT 2 and the ImageResource.  No problem (or so I think):

   private String createHeaderHTML(ImageResource imageRsrc, String
 caption) {
     return span style='white-space:nowrap'img src=' +
 imageRsrc.getURL()
         + ' + caption + /span;
   }

 All well and good in Firefox and Safari, but not in IE.  In IE (I'me
 testing with IE7) I get the **entire** image bundle of some dozen
 16x16 icons.

 How can I get the same effect--one image--without creating them
 individually?

You'd have to use:
   AbstractImagePrototype.create(imageRsrc).getHTML()
in GWT 2.0 for the equivalent of the ImageBundle code.

...or you can use a ClientBundle with both an ImageResource and a
CssResource containing a @sprite, and then:
   return span style='white-space: nowrap'span style='display:
inline-block' class=' + clientBndl.css().sprite() + '/span  +
caption + /span;

(well, you'd probably pass a 'String className' argument instead,
which you'd set to clientBndl.css().sprite() or whatever when calling
createHeaderHTML)
-- 
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-tool...@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.




Re: ImageResource bug in IE7

2010-01-08 Thread Thad
Thanks.  AbstractImagePrototype.create(imageRsrc).getHTML() is it.

On Jan 8, 11:21 am, Thomas Broyer t.bro...@gmail.com wrote:
 ...

 You'd have to use:
    AbstractImagePrototype.create(imageRsrc).getHTML()
 in GWT 2.0 for the equivalent of the ImageBundle code.

 ...or you can use a ClientBundle with both an ImageResource and a
 CssResource containing a @sprite, and then:
    return span style='white-space: nowrap'span style='display:
 inline-block' class=' + clientBndl.css().sprite() + '/span  +
 caption + /span;

 (well, you'd probably pass a 'String className' argument instead,
 which you'd set to clientBndl.css().sprite() or whatever when calling
 createHeaderHTML)
-- 
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-tool...@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.