Apache Wicket Cookbook
Packt recently published Igor Vaynberg's "Apache Wicket Cookbook" and I was fortunate enough to receive a review copy. I've been a Wicket user since long before it was Apache Wicket. I've developed applications ranging in complexity from simple IRC bot log viewers to conference management suites. Knowing Wicket reasonably well, I tend to not bother reading books on the subject as most of them are aimed at the beginner. And those I find just a tad boring.
What caught my eye about this book in particular, though, was the "cookbook" approach to the writing. This book does assume that you know at least the basics of Wicket. It doesn't spend any time on trying to justify Wicket's design or approach. What it does do is get you into your code quickly. The examples cover clearly a number of very common use cases and starts to fill in the corners (to borrow a phrase from Tolkien). What I appreciated most about this book is that there are so many things that we, as wicket users and developers, just do because that's How It's Done. While he doesn't start you from zero, Igor takes some time to explain a few of the whys and wherefores: the sometimes subtle implications of why things are done certain ways, the consequences and options of other approaches.
The tone of the book is light and easy. Unlike a "from scratch" style book, this one really is just a reference book of sorts. If you'd like to deepen your understanding of Wicket, you should certainly read this cover to cover. However, if you're just struggling with a topic or two, the targeted approach of the writing lets you zoom in on your problem and get back out to your app with little fuss. It's the kind of book that I think long time users will appreciate. If you use wicket to any extent, it wouldn't hurt to have a copy of this handy.
To whet your appetite, Packt Publishing has made a chapter available. Chapter 5, Displaying Data Using Data Table, can be freely downloaded directly from the publisher's site. Looking at the table of contents, you can see the book covers quite few hot spots in the development of any application:
- Chapter 1: Validating and Converting User Input
- Introduction
- Performing form-level custom validation
- Creating a custom validator
- Composing multiple validators into a single reusable validator
- Converting string inputs to objects
- Chapter 2: Getting Down and Dirty with Forms and Form Components
- Introduction
- Creating linked selectboxes
- Composing multiple form components into a single reusable component
- Preventing multiple form submits
- Protecting against spam with a CAPTCHA
- Chapter 3: Making Forms Presentable
- Introduction
- Changing form component CSS class on validation errors
- Using FeedbackPanel to output form component specific messages
- Streamlining form component presentation using behaviors
- Chapter 4: Taking your Application Abroad
- Introduction
- Storing module resource strings in package properties
- Retrieving a localized string
- Feeding dynamic localized strings to components using StringResourceModel
- Using wicket:message to output localized markup
- Overriding localized resources on a case by case basis
- Chapter 5: Displaying Data Using DataTable
- Introduction
- Sorting
- Filtering
- Making cells clickable
- Making rows selectable with checkboxes
- Exporting data to CSV
- Chapter 6: Enhancing your UI with Tabs and Borders
- Introduction
- Creating tabs with dynamic titles
- Making a tabbed panel play nice with forms
- Creating a client-side JavaScript tabbed panel
- Using borders to decorate components
- Creating a collapsible border
- Chapter 7: Deeper into Ajax
- Introduction
- Adding Ajax validation to individual form components
- Blocking until an Ajax request is complete
- Providing Ajax feedback automatically
- Chapter 8: Visualizing Data with Charts
- Introduction
- Charting with Open Flash Chart
- Feeding chart data using a SharedResource
- Responding to clicks
- Chapter 9: Building Dynamic and Rich UI
- Introduction
- Swapping components using a select box
- Creating dynamic forms
- Creating a dynamic portal layout
All told this is a great book and a great addition to your library. This is easily something I'll keep coming back to while building wicket apps.