Image component refresh not working under Firefox 2.0.0.9 works under IE

33 views
Skip to first unread message

dbexternal

unread,
Nov 25, 2007, 8:17:44 PM11/25/07
to Google Web Toolkit
Greetings:

I'm attempting to refresh an image via a Button, per the below code.
Works fine for IE, just not Firefox. Any suggestions? Thanks!


captchaPanel = new VerticalPanel();
captchaInputPanel = new HorizontalPanel();
captchaText = new TextBox();
captchaInputPanel.add(captchaText);
captchaImage = new Image(GWT.getModuleBaseURL() + "captcha");
captchaInputPanel.add(captchaImage);
Button refreshImage = new Button("Refresh Image", new ClickListener()
{
public void onClick(Widget sender) {
captchaInputPanel.remove(captchaImage);
captchaImage = new Image(GWT.getModuleBaseURL() + "captcha");
captchaInputPanel.add(captchaImage);
}
});
captchaPanel.add(captchaInputPanel);
captchaPanel.add(refreshImage);

Peter Blazejewicz

unread,
Nov 25, 2007, 9:03:30 PM11/25/07
to Google Web Toolkit
hi,
try to add random param to your image url to bypass browser cache,

String rand = "?rand="+System.currentTimeMillis();

regards,
Peter

dbexternal

unread,
Nov 25, 2007, 9:14:39 PM11/25/07
to Google Web Toolkit
That did it. Thanks Peter!

On Nov 25, 9:03 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages