Useful components, models and other stuff for Wicket (mainly 6) projects
Available in Maven central repository. Add this to your pom.xml
<dependency>
<groupId>com.nitorcreations</groupId>
<artifactId>wicket-components</artifactId>
<version>1.7</version>
</dependency>
ViewSizeToolbar
- change the view size of aDataTable
MaxLengthTextField
ShorteningLabel
- shortens the display value and adds an ellipsisCollapsingBorder
andCollapsingContainer
for ajax based collapsing content
AjaxElementChoice
- works similarly to a radio group but on arbitrary components
- Converters for Joda-Time's
LocalDate
,LocalTime
, andDateTime
GroupingMultimapModel
/GroupingModel
- A model that groups a list of items by a Lambdaj argument specified by getKeyArgument(). The lists will be kept in order by specifying Ordering for keys and values in getKeyOrdering() and getValueOrdering(), correspondingly.JoiningPropertyModel
- joins a list by using the property expression and ordering them naturally. E.g.,List<String> { "abc", "d", "ef" }
could be joined bylength
to "1, 2, 3"ListingStringResourceModel
- joins a list by internally wrappingStringResourceModels
. E.g., properties:stringLength=len: ${length}
, Java:new ListingStringResourceModel<String>("stringLength", Model.ofList(Arrays.asList("abc", "d", "ef")))
=> "len: 3, len: 1, len: 2"MapEntryModel
- a dynamic map entry accessor modelNullWrapperModel(IModel first, IModel second)
- returnssecond.getObject()
iffirst.getObject()
isnull
StringFormatModel
- works likeString.format(..)
VisibilityNullBehavior
Factories forBehavior
s which sets theComponent
's visibility based on the default model's or some other components model object. Used to reduce boiler-plate code with typical scenarios of components needing to be hidden or visible based on nullity of certain model object.ErrorFieldBehavior
- Adds red borders to any components with validation errors (Since 1.1)
WicketAjaxTimeoutFilter
- refreshes the page on ajax request after session has expired. Works with Wicket 6.
AjaxUtil
- helpers for common Wicket ajax tasks:add(target, Component...)
,add(Component...)
,getTarget()
AnnotationEventDispatcher
- scans instantiated components forOnEvent
annotated methods and dispatches events based on payload type.
CheckedValidator
- validates that a checkbox is checked (Since 1.1)MatchingValidator
- validates that the value matches a given Hamcrest matcher (Since 1.1)PhoneNumberValidator
- validates that the String value contains only0-9+-()
(Since 1.1)