Images not displaying when application is deployed

406 views
Skip to first unread message

Dany Joos

unread,
May 21, 2010, 5:34:19 AM5/21/10
to gwt...@googlegroups.com

I'm trying to display an image on a panel with the following code.    I've tried .png, .gif, and .ico files and get the same results each time.

When deployed all I see is either blank or the red x.    Any information would be greatly appreciated.

Thanks, Dany

Image gwtImage =

new
Image("js/ext/resources/images/custom/Remove-32.png");

gwtImage.setTitle(

"I am a GWT Image Widget");

apContactListViewBrowser.add(gwtImage, 153, 157);

gwtImage.setSize(

"78px", "70px");

image.setVisible(

true);

--
You received this message because you are subscribed to the Google Groups "GWT-Ext Developer Forum" group.
To post to this group, send email to gwt...@googlegroups.com.
To unsubscribe from this group, send email to gwt-ext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-ext?hl=en.

Patrizio De Michele

unread,
May 21, 2010, 6:45:47 AM5/21/10
to gwt...@googlegroups.com
check if the string casing is right....maybe on the HD is called remove-32.png...

2010/5/21 Dany Joos <dany...@sympatico.ca>

Dany Joos

unread,
May 21, 2010, 1:38:47 PM5/21/10
to gwt...@googlegroups.com
thanks Patrizio, the casing is correct though.    Also in case it matter, but I don't think it should; apContactListViewBrowser onto which the image is being added is an absolute panel.
Dany

Patrizio De Michele

unread,
May 21, 2010, 2:00:39 PM5/21/10
to gwt...@googlegroups.com, Dany Joos
have you checked if the image is present in the place where should be after the deploy?

Dany Joos

unread,
May 21, 2010, 2:53:20 PM5/21/10
to gwt...@googlegroups.com
I"m pointing to this location and they've been successfully deployed to this folder.    Are there issues with deploying to this folder?
 
C:\MyLiferay\jboss-tomcat-4.2.3\server\default\deploy\GWTHorseContactPortlet.war\gwthorsecontactportlet\js\ext\resources\images\custom
 
 
Should I be deploying to here?
 
C:\MyLiferay\jboss-tomcat-4.2.3\server\default\deploy\GWTHorseContactPortlet.war\gwthorsecontactportlet\gwt\standard\images

Thomas Arp

unread,
May 21, 2010, 3:13:26 PM5/21/10
to gwt...@googlegroups.com

Your issue might be the lack of a leading slash – have you tried with this?

Image gwtImage = new Image("/js/ext/resources/images/custom/Remove-32.png");

Thomas

Dany Joos

unread,
May 21, 2010, 5:04:22 PM5/21/10
to gwt...@googlegroups.com
I tried with the slash but it didn't do anything, other than I lost the image in Design mode.   I'm using GWT Designer and my images show up ok in Designer.   It's when I deploy them that they don't show.    When I added and selected the image GWT Designer generated the following line of code with the following path; which is where the image is located (I just picked one of the standard images).
 
Image gwtImage = new Image("js/ext/resources/images/custom/Remove-32.png");
 
When I've deployed the portlet to liferay/jboss/tomcat, the image does appear in the following deployment folder.
 
C:\MyLiferay\jboss-tomcat-4.2.3\server\default\deploy\projectname.war\projectname\js\ext\resources\images\custom
 
Is there any good documentation on creating and deploying GWT images?
 
I've tried adding gwtImage.setVisible(true) and it didn't do anything.   I've tried just about everything with the paths and even tried dropping the image in various folders and it didn't do anything.
Are there any additional statements needed to get an image to display on a panel when you deploy it?
 
 
----- Original Message -----

Dany Joos

unread,
May 22, 2010, 1:01:52 AM5/22/10
to gwt...@googlegroups.com, Thomas Arp, Patrizio De Michele
Just wanted to post the fix, and thank Patrizio and Thomas for your suggestions.
It was a path error.    Here is the fix.
thanks,
Dany
 
Image gwtImage = new Image(GWT.getModuleBaseURL() + "js/ext/resources/images/default/dd/drop-add.gif");
Reply all
Reply to author
Forward
0 new messages