I’ve release the first version of my Wicket UI library that makes creating simple Wicket UI’s event faster and simpler! I’ve been using a derivative of it in my professional projects for many years, and now that code has been refactored into a standalone library.
It’s based on Wicket 8 and Bootstrap 4 and comes with a complete sample Wicket app demonstrating usage. The first release includes various text, date, dropdowns, multi-select, numeric, radio, and checkbox fields. Future releases will include even more field types!
Why you want to use it
- Simple, consistent syntax based on the Builder pattern is used to instantiate any type of field
- No HTML required, just add a placeholder tag, and the HTML is created for you
- All field are easily customizable using .properties files. Supports multiple locals/environments
- Easily toggle fields from read-write to read-only
- Optimized for Wicket page size by minimizing number of components create
Simple usage
// 1. In your WebApplication.init() method, initialize the WicketFieldsUI library
WicketFieldsUI.init(this);
// 2. Add the UiFieldsBehavior to your WebPage which will add all the necessary resources
add(new UiFieldsBehavior());
// 3. Add the placeholder tag for your field in your .html file
<span wicket:id="userFirstName"></span>
// 4. Add the field to your WebPage
add(new TxtField<String>(FieldArgs.Builder.of("userFirstName", "First Name", LambdaModel.of(user::getFirstName, formData::setFirstName)).build()));
// 5. When you are done adding your fields, send the InitPanelFieldsEvent event to notify them to init themselves
send(this, Broadcast.BREADTH, new InitPanelFieldsEvent(null));
GitHub repository
The repository contains much more documentation and a full working sample web app. Check it out here!