getUrl does not return image.

31 views
Skip to first unread message

stymie

unread,
Mar 24, 2012, 7:01:18 PM3/24/12
to Google Web Toolkit
I have the following code and it does not seem to be working. Not sure
what the trouble might be though?


if(soundImage.getUrl().equals(GWT.getModuleBaseURL()+"/soundOn.png")){
Window.alert("YEP IT DOES");
soundImage.setUrl("soundOff.png");
setSound("off");
}else{
soundImage.setUrl("soundOn.png");
setSound("on");
}

Joseph Lust

unread,
Mar 25, 2012, 11:06:22 AM3/25/12
to google-we...@googlegroups.com
Why are you checking for the image this way? If you're using a ClientBundle, getUrl() might be returning a data url, which would be correct, but fail your test here.

Try printing out via GWT.log() the actual URL used and letting us know what that is.

Sincerely,
Joseph

dodo dard

unread,
Mar 26, 2012, 7:36:06 AM3/26/12
to google-we...@googlegroups.com
You should give more info about this problem, what is not working is unclear to me.

Regards,
Bowie
=================
Reply all
Reply to author
Forward
0 new messages