wicketstuff-lightbox
Overview
Wicketstuff-lightbox provides a means to simply include lightbox behavior into your wicket applications. The project includes a wicket behavior to add all the required javascript to your pages by itself, as well as components to make programmatic addition of images using the behavior very simple. As of release 1.02, wicket resources can also be used to provide the images.
Usage
LightboxImageData
Regardless of which component you use to render the lightbox images, the first step in creating them is to create a LightboxImageData structure. The only thing you must provide is a url to the enlarged image. A number of other parameters affecting how it is displayed can optionally be provided.
... // Only the enlarged image url is required, all other attributes can optionally be added. LightboxImageData d = new LightboxImageData.Builder("images/apic.jpg") .thumbUrl("images/apic-thumb.jpg") .group("main") .caption("A beautiful picture.") .build(); ...
Simple LightboxImages
... // Create the model... IModel model = new LightboxImageData.Builder("images/big.jpg") .thumbUrl("images/thumb.jpg").model(); // Add the component using one of the following methods... add( new LightboxImage("mywicketid", model)); // Adds the image inline... add( new LightboxImagePanel("mypanelid", model)); // Adds the image wrapped in a div... ...
Popping Up from a Text Link
... // Create the model... IModel model = new LightboxImageData.Builder("images/big.jpg") .linkText("click me").model(); // Add the component... add(new LightboxImage("mywicketid", model)); ...
Using the LightboxImageRepeater
... ArrayList<LightboxImageData> imgs = new ArrayList<LightboxImageData>(); imgs.add(new LightboxImageData.Builder("images/img1.jpg").group("main").build()); imgs.add(new LightboxImageData.Builder("images/img2.jpg").group("main").build()); add(new LightboxImageRepeater("repeaterid", imgs, true)); ...
Versions
| wicketstuff-lightbox |
released |
wicket |
lightbox |
comments |
extra credit |
|---|---|---|---|---|---|
| v.1.02 | 05/10/2008 |
v.1.3.1 |
v.2.03.3 |
Adds wicket resource functionality |
Thanks Roland! |
| v.1.01 | 03/01/2008 |
v.1.3.1 |
v.2.03.3 |
Initial release |
SVN Repository
The SVN repository of this project is available at https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-lightbox/