Wave Panel for Wicket

in case someone thought it was a good idea: We’re delighted to introduce a new wicket component which will allow you to easily integrate Google Waves right into your application. Please meet GoogleWavePanel ! The idea of making this component came from a recent tutorial which aimed at clarifying the use of Google’s Wave Embed [...]

Playing with Wicket’s templates

Wicket comes with some templating facilities. They’re often handy, especially when integrating JavaScript components. Yet, for some reasons I don’t get, these functionalities aren’t much advertised. Anyway, let’s dig in ! Basically, this templating is about some text containing variables, for example ${variable}, whose values are provided through Java code. Let’s take a simple example, [...]

Hibernate statistics page

Hi ! We were some time ago at a presentation about hibernate (at a Karlsruhe JUG event). The presenter, Michael Plöd showed us a nice Hibernate statistics page. As you can bet, we went for reusing it However, in doing so, some issues appeared, and in the end we thought the updated version could be [...]

Wicket gem: Gravatar

from the javadoc: Creates an image that is rendered by the Gravatar online service. Gravatars are user icons that are registered by a central server and that can be used across the internet with blogs, forums and other profile based websites. The Gravatar requires the email address for which the gravatar image needs to be [...]

Wicket gem: AdapterModel implements IModel

Recently, on the Wicket-User mailing list: What’s the best practice when using generics with models that take some object but return another type of object? examples: When you have a collection and need to convert it to a list for listview purposes. to which mighty Igor replied:  Java |  copy |? /** * Simplifies implementing wrapper models that adapt from [...]

How to do UI test ?

Me again… Well, I just wanted to speak about an issue for which I didn’t find any proper answer yet. The matter is gui testing. Currently, at work, we do proper unit test for “framework level code”. By “framework code”, I mean code being in some utilities or services projects which are put there to [...]

Wicket 1.4.1 supports Ajax file uploads | Wicket in Action

via Wicket 1.4.1 supports Ajax file uploads | Wicket in Action. The Apache Wicket project is proud to announce the first maintenance release: Apache Wicket 1.4.1. The most notable change in this release is the transparent support for multipart form submissions via Ajax. Wicket is now smart enough to submit a form using a hidden [...]

Best practice for building wicket components

i just sent this bit to the list [while this is] valid with about any wicket component that uses a JS lib, i´m making the jQuery case here: as it is a good practice to add functions (aka plugins) to the jQuery object, including the jQuery script more than once in a page is not [...]

Wicket resource caching

Whenever you add extensive caching to your wicket resources, this might be awfully useful:  Java |  copy |? Application.getResourceSettings().setAddLastModifiedTimeToResourceReferenceUrl(true); which exactly does what you can get from the name

Yui Compressor mojo

as we´re into bundling Wicket/JQuery-frontend components lately, we needed a way of automatically minimizing JavaScript on deployment. luckily, there is an excellent mojo out there : http://alchim.sourceforge.net/yuicompressor-maven-plugin the nice thing is, it does not only minify but also check and obfuscate, which turned out to be very handy! if you´re bundling javascript (or even css, [...]

Wicket : provide a body to your tags !

Hi We had a strange issue here : we created a component opened for extension. For some reason it was working with a Label but not a MultilineLabel. Crazy isn’t it ? It turned out we declare this “opened” component like this : The user of it should just override a callback method like this [...]

pitfall on implementing generic methods

disclaimer: don´t get me wrong. 90% of the time i like generics. most of the time it only starts getting weird, when you end up using something like  Java |  copy |? IModel< List<EntityModel<Address<Person>>>> getAddressModels(); but hey, nothing is perfect. recently stumbled over an easy to avoid mistake you can make introducing generics to your APIs. this tale is [...]

Interesting serialization trick

Wicket is a well known serialization addict, and as such it’s quite often a topic when dealing with wicket pages and, especially, going back through the page map. In doing so, we had recently the following surprise : the DefaultMutableTreeNode, a javax.swing.tree class, is used to to the current incarnation of the tree component in [...]

wicket : setGatherExtendedBrowserInfo doesn’t play well with Ajax

As I’ve written on the wicket jira, setGatherExtendedBrowserInfo doesn’t play well with Ajax. For the explanation, here are Igor 2 cents on it : ajax doesnt work because probably the ajax request is redirected to that page…that page is what gathers all the browser info through javascript… . Maybe I am a bit picky, but [...]

no graphic artists were hurt during the process…

that was fun. not that i actually liked these bonbon-buttons, but the disclaimer on their page is hilarious. having a second look, that layout-manager concept can be actually useful.

IDetachListener saves the day

i just asked this on the Wicket user list: we have a problem here, which we think might be a common one, so i´d like to discuss. from time to time we create models (mostly LDMs) that are not actually reachable by components. (yes, you can argue that this is stupid, but it happens where [...]

Wicket 1.3.6 Release

Wicket 1.3.6 was released. The best news for me there is, that using Guice and persistent Sessions is probably going to work now (did not check yet.)

Performance of Wicket vs Seam + JSF

even though Gavin King expectedly disagrees, i find this article a very useful benchmark. not that much of a surprise, but the actual numbers are more than impressive.

Pagelink considered harmful

ahhh. doesn’t wicket offer a great model of programming webpages? isn’t it too easy to do things like this?  Java |  copy |? add(new ListView("mylist",someList){ @Override protected void populateItem(ListItem item){ item.add(new PageLink("deleteThisEntry",new DeletePage(item.getModel()))); }};}); but wait PageLink(Page) is deprecated:  Java |  copy |? /** * This constructor is ideal if a Page object was passed in from a previous Page. Construct a * link to [...]

Quartz fits

whenever you have any need for cron-like functionality within your java application, Quartz is the obvious chose for quite a long time now. i did not need much of what quartz had to offer, so i went with a home-grown implementation. why? the fear of having to integrate a good, but feature-rich framework, you really [...]

AnchoredBookmarkablePageLink

Another Wicket Gem. Obvious but helpful.  Java |  copy |? import org.apache.wicket.PageParameters;import org.apache.wicket.markup.ComponentTag;import org.apache.wicket.markup.html.link.BookmarkablePageLink;import org.apache.wicket.model.IModel; /*** @author Thijs Vonk**/public class AnchoredBookmarkablePageLink extends BookmarkablePageLink {  private static final long serialVersionUID = 1L;  private IModel stringAnchor;  public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel anchor) { super(id, pageClass); this.stringAnchor = anchor; }  public AnchoredBookmarkablePageLink(String id, Class pageClass, PageParameters params, IModel anchor) { super(id, pageClass, [...]

Article about Wicket vs. Tapestry 5

The article is about Tapestry 4.1, not v5 as mentioned in the title. Some say, Tapestry can compare with Wicket. And from a certain perspective, they’re obviously right. In case you have not made up your mind yet, this developerworks article might help you. In there is a thorough side-by-side comparison of tapestry against wicket. [...]

Wicket and AJAX

Here is an interesting interview with three of the wicket committers (or, should i say legends, personal heros …) about how Wicket hides the complexity of AJAX-related JavaScript coding from the productive programmer: Learning JavaScript is not hard, what is hard is learning FireFox JavaScript, IE6 JavaScript, IE7 JavaScript, Opera JavaScript, WebKit JavaScript, etc. The [...]

Wicket, Guice and java.lang.reflect.Type

if there is anyone suffering from https://issues.apache.org/jira/browse/WICKET-1403 , i added a quick hack to make it possible to restart the server while persisting the application’s state. not a final solution, but it works for now and makes the development cycle much faster (for me) The Problem is, that java.lang.reflect.Type is not Serializable right now. The [...]

Wicket DropDownChoice with eye-candy

thinking twice, ajax-indicators are not at all eye-candy, but useful from an usablity perspective.  Java |  copy |? /** * Adds an AJAX-Indicator to DropDownChoice * @author Eyal Golan */class DropDownChoiceWithAjaxIndicator extends DropDownChoice implements IAjaxIndicatorAware{ private static final long serialVersionUID = 1365817942506006686L; private final WicketAjaxIndicatorAppender indicatorAppender = new WicketAjaxIndicatorAppender();  public DropDownChoiceWithAjaxIndicator(final String id, final IModel choices, final IChoiceRenderer renderer, final MarkupContainer markupContainer) [...]

Wicket SecureForm

posted by mighty Igor on the Wicket-User list: Here is a simple demonstration of how to prevent “Cross-Site Request Forgery”  Java |  copy |? /** * Form that uses a random uuid token in order to prevent nasty people from messing around (also known as cross site request forgery) ;)  * @author igor vaynberg */class SecureForm extends Form{ public SecureForm(final String id) [...]

Wicket Breadcrumbs

This template for using a Breadcrumb-like Navigation really shows the beauty of stateful pages that separate wicket from those countless template-based frameworks.  Java |  copy |? /** * Provides a list of Breadcrumbs. THIS IS ONLY A TEMPLATE. DO NOT USE UNMODIFIED * @author igor vaynberg */public abstract class BreadcrumbPage extends Page{ private List<breadcrumbpage> history = new ArrayList</breadcrumbpage><breadcrumbpage>();  public BreadcrumbPage() { add(new [...]

Wicket DropDownIdChoice

This one is all about id <-> object mapping when using DropDowns:  Java |  copy |? /** * @author igor vaynberg */public class DropDownIdChoice extends DropDownChoice{  public DropDownIdChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer, Class<?> type) { super(id, model, choices, renderer); setType(type); }  @Override public String getModelValue() { final Object id = getModelObject(); if (id != null) { return getConverter(getType()).convertToString(id, [...]

Wicket ResubmitSafeForm

Another little gem: /** * Form that divides submit-events to inital and resubmit. * @author igor vaynberg */ abstract class ResubmitSafeForm extends Form { private boolean submitted; private static final long serialVersionUID = 1L; public ResubmitSafeForm(final String id) { super(id); } public ResubmitSafeForm(final String id, final IModel model) { super(id, model); } protected abstract void [...]

Wicket TextLink

Another very simple, yet incredibly helpful snippet: /** * Simple Link that renders its Model as a textual body * @author Al Maw */ abstract class TextLink extends Link { public TextLink(final String id, final IModel model) { super(id, model); } @Override protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) { // Draw anything before [...]

Back to Resin

while this blog happily ran on glassfish v1 for quite some time now, i have to admit switching back to caucho resin. the reason for this is simple: i will be using resin at work soon again, so any detailed experience with glassfish (at least with anything <v3) will be void. i worked with resin2 [...]

Wicket Gems

it happens quite often that, while browsing the Wicket mailing list, i stumble upon gems, that i fail to find or even remember when i could use them. this really has to stop the problem is: there is of course no commen theme about these hacks, components, behaviours etc, so it is very hard to [...]

Wicket-CSSMenu

i just released a simple css-menu component for wicket as a preview.as always, your’re very welcome to send any kind of criticism.

Wicket, Guice and persistent PageStore

I filed another guice related issue at Wicket’s Jira https://issues.apache.org/jira/browse/WICKET-1403 . Seems, the injection stuff needs some treatment before the ultra-fast-turnaround development environment will come true. Let’s hope for the best.

Google charts as Wicket component

If you do not have a problem sending Data to Google (some have) and you don’t want to create fancy charts for your wicket application yourself, this component can save you a significant amount of time.Thanks to Daniel Spiewak for sharing this.