Ooh, I forgot to say that I'm using these images to be displayed in a lightbox. This lightbox expects an image URL in it's href i.e "images/myImage.png". Someone already has the same issue?
Kind Regards, Hbiloo On Thu, Jul 16, 2009 at 12:29 AM, Hbiloo <[email protected]> wrote: > Hi everybody, > > I've a list of thumbnail images that are dynamically generated from a byte > [] retrieved from the database. Each thumbnail links to the big image > variant of it. > My code: > > ... > > @Override > > protected void populateItem(final ListItem<MyImage> item) { > > final int index = item.getIndex(); > > final MyImage mImage = item.getModelObject(); > > ResourceLink<ByteaImageResource> myImageLink = > newResourceLink<ByteaImageResource>( > "myImageLink", > > new ByteaImageResource(myImage.getImage())); > > myImageLink.add(new FancyBoxBehavior()); > > myImageLink.add(new ContextImage("ribbonImage", newModel<String>( > RIBBON_IMAGE)).setVisible(myImage.isMain())); > > myImageLink.add(new Image("myImage", > newByteaImageResource(myImage.getImage()))); > > item.add(myImageLink); > > } > > ... > > > public class ByteaImageResource extends DynamicImageResource { > > private byte[] imageData; > > > public ByteaImageResource(byte[] imageData) { > > this.imageData = imageData; > > super.setLastModifiedTime(Time.now()); > > } > > > @Override > > protected byte[] getImageData() { > > return imageData; > > } > > } > > > This is how I would like the HTML to be generated: > ... > <a href="images/image1.png" id="myImageLink1" wicket:id="myImageLink"> > > <img width="80" height="80" src="images/myImageBig1.png" > wicket:id="myImage"/> > </a> > <a href="images/image2.png" id="myImageLink2" wicket:id="myImageLink"> > > <img width="80" height="80" src="images/myImageBig2.png" > wicket:id="myImage"/> > </a> > ... > > How can I get these images as a mounted images and not as link such as: > http://localhost:8080/myApp/?wicket:interface=:0:sidebarPanels:1:sidebarPanel:contentContainer:myImages:1:myImageLink::IResourceListener > :: > > Kind Regards, > > Hbiloo >
