public class StringValidatorWithMaxLength extends Object
StringValidator-s but these add maxlength attribute to the html tag. If you
want to see this functionality in Apache Wicket vote on
https://issues.apache.org/jira/browse/WICKET-1310| Modifier and Type | Field and Description |
|---|---|
static String |
MAX_LENGTH
"maxlength" standard html input attribute name
|
| Constructor and Description |
|---|
StringValidatorWithMaxLength() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addMaxLengthToTag(org.apache.wicket.Component component,
org.apache.wicket.markup.ComponentTag tag,
int maxLength)
Adds a maxlength attribute to the tag.
|
static org.apache.wicket.validation.validator.StringValidator |
exactLength(int length)
Works like
StringValidator.exactLength(int) but the returned validator is also adding
maxlength attribute to the html tag. |
static org.apache.wicket.validation.validator.StringValidator |
lengthBetween(int minimum,
int maximum)
Works like
StringValidator.lengthBetween(int, int) but the returned validator is also
adding maxlength attribute to the html tag. |
static org.apache.wicket.validation.validator.StringValidator |
maximumLength(int maximum)
Works like
StringValidator.maximumLength(int) but the returned validator is also
adding maxlength attribute to the html tag. |
public static final String MAX_LENGTH
public static void addMaxLengthToTag(org.apache.wicket.Component component,
org.apache.wicket.markup.ComponentTag tag,
int maxLength)
component - owning wicket componenttag - tag to add tomaxLength - attribute valuepublic static org.apache.wicket.validation.validator.StringValidator exactLength(int length)
StringValidator.exactLength(int) but the returned validator is also adding
maxlength attribute to the html tag.length - the required length of the stringStringValidatorpublic static org.apache.wicket.validation.validator.StringValidator lengthBetween(int minimum,
int maximum)
StringValidator.lengthBetween(int, int) but the returned validator is also
adding maxlength attribute to the html tag.minimum - the minimum length of the stringmaximum - the maximum length of the stringStringValidatorpublic static org.apache.wicket.validation.validator.StringValidator maximumLength(int maximum)
StringValidator.maximumLength(int) but the returned validator is also
adding maxlength attribute to the html tag.maximum - the maximum length of the stringStringValidatorCopyright © 2017. All rights reserved.