0

I am following this guide for displaying images in wicket How to load external Images

I see one problem and dont know how to solve it. Consider this piece of code

StaticImage img=new StaticImage( "icon", new Model(loadingGIFURL));
//get real image url
img.setDefaultModel(new Model(realURL))

It doesnt show the loading gif, because I override the DefaultModel. So how can I still show my loading gif but "preload" the real image and when the real image is downloaded then replace the loading gif with my image.

Note that I dont have a image source like base64, I only have the image url

greedsin
  • 1,252
  • 1
  • 24
  • 49
  • I think this is some kind of I already have. Did you read the link? Changing the src to an URL starts the requests to load the image, but I want to show the gif WHILE it is loading – greedsin Nov 27 '17 at 15:34
  • 2
    Hi, this looks more a problem that you could solve with JavaScript rather than on server side. Check this question: https://stackoverflow.com/questions/4635388/how-to-display-loading-image-while-actual-image-is-downloading – Andrea Del Bene Nov 27 '17 at 21:19

0 Answers0