No one has experience with LightBox/Slimbox/Shadowbox/Other? How do you implement same src (in <img>) and href (in <a>) attributes to make it works?
> -----Original Message----- > From: Miroslav F. [mailto:mir...@seznam.cz] > Sent: Monday, 25. July 2011 21:55 > To: users@wicket.apache.org > Subject: RE: url for images from database > > Thanks, was looking on classes :-) > > Now I have code: > > HTML: > <div style=" border: 1px solid #DCD4A7; > float: left; position: relative; > width: 207px; height: 340px; > margin-top: 5px; margin-right: 20px; > margin-bottom: > 10px;"> > <a href="#" wicket:id="anchor" > rel="zbox" > title=""> > <img style="border: 3px solid > #DCD4A7; padding: > 1px 1px 1px 1px; width: 199px; height: 149px;" alt="" src="" > wicket:id="image"> > </a> > > Wicket: > DBImage image = new DBImage(); > image.setImageData((byte[]) dataFromDB.get(dataOffset)); > > //not to cache images in browser > Double random = Math.random(); > > //put image into shared resources > Start.get().getSharedResources().add("image"+((String) > dataFromDB.get(textOffset)) + random.toString() + ".jpg", > image); ResourceReference imageResource = new > ResourceReference("image"+((String) > dataFromDB.get(textOffset))+ random.toString()+".jpg"); > String url=RequestCycle.get().urlFor(imageResource).toString(); > > //make "href" in "a" and "src" in "img" point to the same > location for zbox to make work ExternalLink odkaz = new > ExternalLink("anchor", url); WebMarkupContainer > imageSrcAttribute = new WebMarkupContainer("image"); > imageSrcAttribute.add(new AttributeModifier("src", new > Model<String>(url))); odkaz.add(imageSrcAttribute); > odkaz.add(new SimpleAttributeModifier("title", (String) > nazvy.get(i))); > > this.add(odkaz); > > > This works, not know if code is good from point of right way > to do this in wicket.. > > Miro > > > > > -----Original Message----- > > From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > > Sent: Thursday, 14. July 2011 18:11 > > To: users@wicket.apache.org > > Subject: Re: url for images from database > > > > look at the very bottom of that page.... > > > > -igor > > > > On Thu, Jul 14, 2011 at 6:50 AM, Miroslav F. > <mir...@seznam.cz> wrote: > > > Still be lost :-( > > > > > > This code I have in AppStart class: > > > mountSharedResource("/images/image1.jpg", new > > > ResourceReference(Images.class, > > "image1.jpg").getSharedResourceKey()); > > > > > > Now after reading recomended example still not idea how to > > replace new > > > ResourceReference(... in above code snippet in a way in > which I get > > > from byte[] shared resource key. > > > > > > Please be kindfull, I'm in low level in java and greenhorn > > in wicket > > > :-D > > > > > > Miro > > > > > > > > > > > >> -----Original Message----- > > >> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > > >> Sent: Tuesday, 12. July 2011 17:09 > > >> To: users@wicket.apache.org > > >> Subject: Re: url for images from database > > >> > > >> https://cwiki.apache.org/WICKET/uploaddownload.html > > >> > > >> -igor > > >> > > >> On Tue, Jul 12, 2011 at 2:54 AM, Miroslav F. > > <mir...@seznam.cz> wrote: > > >> > Is there example? How to get shared resource key from > > byte[] (image > > >> > from DB)? In my App class i do for several shared resources: > > >> > mountSharedResource("/styles/style.css", new > > >> > ResourceReference(Styles.class, > > >> "style.css").getSharedResourceKey()); > > >> > > > >> > Is is possible in this code getsharedResource() for byte[] > > >> (image from > > >> > DB) in some way? > > >> > > > >> > > > >> >> -----Original Message----- > > >> >> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > > >> >> Sent: Sunday, 10. July 2011 18:16 > > >> >> To: users@wicket.apache.org > > >> >> Subject: Re: url for images from database > > >> >> > > >> >> use a shared resource to output the images instead of > an Image > > >> >> component > > >> >> > > >> >> -igor > > >> >> > > >> >> On Sun, Jul 10, 2011 at 6:44 AM, Miroslav F. > > >> <mir...@seznam.cz> wrote: > > >> >> > Hi folks, > > >> >> > > > >> >> > please direct me to right docu with following problem: I > > >> >> have image as > > >> >> > byte[] from database which I display on pages. > > >> >> > > > >> >> > Works fine, on image atribute src is somethink like this: > > >> >> > <img > > >> >> > > > >> > src="?wicket:interface=:0:repeater:1:obrazok::IResourceListener::"/ > > >> >> > > > > >> >> > > > >> >> > For lightbox I need make this "ugly" src atribute > > transform to > > >> >> > something like src="/images/xxx.jpg" and mount it > > >> >> on-the-fly but don't > > >> >> > know how to do it. > > >> >> > > > >> >> > Is somewhere related example please? > > >> >> > > > >> >> > Thanks in advance, > > >> >> > > > >> >> > Miro > > >> >> > > > >> >> > > > >> >> > > > >> >> > > >> > > > --------------------------------------------------------------------- > > >> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > >> >> > For additional commands, e-mail: > users-h...@wicket.apache.org > > >> >> > > > >> >> > > > >> >> > > >> >> > > >> > > > --------------------------------------------------------------------- > > >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > >> >> For additional commands, e-mail: users-h...@wicket.apache.org > > >> >> > > >> >> > > >> > > > >> > > > >> > > > >> > > > --------------------------------------------------------------------- > > >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > >> > For additional commands, e-mail: users-h...@wicket.apache.org > > >> > > > >> > > > >> > > >> > > > --------------------------------------------------------------------- > > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > >> For additional commands, e-mail: users-h...@wicket.apache.org > > >> > > >> > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org