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 iframe rather then the standard XMLHttpRequest if the form contains file upload fields.
You can download the release here:
Or use this in your Maven pom’s to upgrade to the new version:
<dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket</artifactId> <version>1.4.1</version> </dependency>
A complete list of changes can be found in our Jira instance.
We thank you for your patience and support.
The Wicket Team
Geertjan is a Netbeans guy, and he has been writing about Netbeans and Wicket for as long as I’ve known him. Today he published a new blog entry showing how to create an Ajax auto-complete text field with Netbeans’ Wicket support and Wicket in 5 easy steps. Can it get any better?
One question is recurring on our user list: how can I prevent a user from clicking an Ajax link multiple times? There are several solutions to this problem, but today I thought up possibly the simplest solution yet for Wicket applications using the infrastructure that is already in place for displaying custom Ajax indicators.
Read the rest of this entry »
Ajax in Wicket is great, for the most part its usage is transparent and things work as you would expect. Where Ajax does not work perfectly, yet, is when it comes to partially updating repeaters. The problem is that repeater components do not have a markup tag of their own and so Wicket cannot transparently figure out where the updates should go.
Consider a simple case of a repeater rendering a list of contacts. Wicket markup looks like this:
1 2 3 4 5 6 7
<body> <table> <tr wicket:id="contacts"> <td><span wicket:id="name"></span></td> </tr> </table> </body>
And the rendered markup looks like this:
1 2 3 4 5 6
<body> <table> <tr><td><span>Lisa Simpson</span></td></tr> <tr><td><span>Bart Simpson</span></td></tr> </table> </body>
As you can see, if we add a new item to the
ListView and try to repaint it via Ajax there is no root markup tag for the Wicket Ajax to replace. This is why it is necessary to add the repeater to a container and then repaint the container instead. In this case we would add a
WebMarkupContainer to the
table tag and repaint it via Ajax instead. This, however, will result in all table rows being rendered and sent over from server to client, which for a lot of cases is undesirable.
It is not too hard to support the usecase of “I added something new to the repeater and want to have just that row added via Ajax”. The trick is to give Wicket a tag to repaint via Ajax which can be accomplished by doing the following:
Accomplishing this is pretty easy. Suppose we create the new item by submitting a form via an
When the form is submitted using the above
AjaxButton only the newly added item is repainted via Ajax instead of the entire table. A functional project is attached below.
This concept can be taken to the next level where a repeater can be “synced” with the markup on the client side. This would involve:
Maybe next time :)
Sample project: partialajax.zip
With this book, Wicket will become the greatest territory the Dutch have settled since Manhattan.
Senior Software Engineer, Teachscape Inc.
This is the complete and authoritative guide to Wicket, written and reviewed by the core members of the Apache Wicket team. If there's anything you want to know about Wicket, you are sure to find it in this book.
Founder and Architect of Apache Wicket, Foreword Wicket in Action
Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket.
Geertjan Wielenga, Wicket Netbeans Plugin Author
The tutorial and conversational tone of the writing makes the book very approachable.
Loved the sample application—it tied everything together.
Senior Software Developer, SAS Institute
The essential guide for learning and using Wicket.
Erik van Oosten
Lead programmer and Project Manager, JTeam
Finally, the Web Framework of web frameworks, Apache Wicket, now has a bible of its own.
Senior Software Architect, Heimore group
Wicket is an innovative evolution of the MVC programming with simple roots, but without a primer such as this, it can be more challenging than it needs to be.
Founder, Bill2 Inc.
Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium.
Nino Martinez Wael
Java Specialist, Jayway Denmark