Image not appearing for ImgButton in SmartGWT

Hi all,

Just wanted to know if there is any image type restrictions for the
images that we use as Icons for Buttons in ImgButton in SmartGWT?

I am trying a sample project but am not seeing the image on the
button. I tried gif images.

regards,

Abhiram

I had asked you to post the relevant portions on your code. The default path that the images are looked under is the “images” subdirectory (ie “public/images” if you’re using GWT 1.6) and not the root webpapp dir. So try placing your image under the “images” directory. If you’re still having issues, use Firebug or Fiddler to monitor the http traffic to see what the requested URL for the image. That will help you troubleshoot the problem.

Sanjiv

Changing th img root for the application

Hi Sanjiv,

How do I change the root directory for images (/images) to an external URL? I want all my static content to be served out of Amazon, including images. Is there a way to change the image dir globally?

Thanks,

_K

Hi,

Sorry for waking an old thread up but i have almost the same issue.

I have all my images located in war/images.

When i set the path to an image to images/icons/blue.png the debugger says that the application has failed to get an image from location images/images/icons/blue.png. Why does it add the path “images” on its own?

I have also tried setting the path to the image to icons/blue.png but then it actually looks for an image at icons/blue.png where there is no image.

ListGridField symbolField = new ListGridField("symbol", "Symbol", 90);
      symbolField.setAlign(Alignment.CENTER);
      symbolField.setType(ListGridFieldType.IMAGE);