Migrating to Wicket 6.0
Environment
- Wicket 6.0 requires at least Java 6
Repeaters
- IDataProvider was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages.
Form Processing
Validation
- `DateValidator` no longer has static factory methods, use `new DateValidator(min,max)` instead
- `StringValidator` no longer has static factory methods, use `new StringValidator(min, max)` instead
- `StringValidator` will add the `maxlen` attribute if added to a component attached to an input tag
- `AbstractValidator` has been removed
- `ValidationError` now makes creating standard error keys (classname and classname.subtype) easier
- Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors
List of renamed classes and methods
Following the renames in subclasses is easier if the @Override annotations are present. IDE-s, like Eclipse, can be used to add missing @Override annotations before moving to wicket 6.
Here's a table of deprecated classes and methods in Wicket 1.5 and the corresponding replacement in Wicket 6.
Wicket 1.5 (deprecated) |
Wicket 6 (replacement) |
---|---|
org.apache.wicket.behavior.SimpleAttributeModifier |
org.apache.wicket.AttributeModifier#replace(...) |
org.apache.wicket.request.Url#toAbsoluteString() |
org.apache.wicket.request.Url#toString(StringMode.FULL) |