Class StringValidatorWithMaxLength
- java.lang.Object
-
- org.wicketstuff.minis.behavior.validator.StringValidatorWithMaxLength
-
public class StringValidatorWithMaxLength extends Object
Similar toStringValidator-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- Author:
- akiraly
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAX_LENGTH"maxlength" standard html input attribute name
-
Constructor Summary
Constructors Constructor Description StringValidatorWithMaxLength()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddMaxLengthToTag(Component component, ComponentTag tag, int maxLength)Adds a maxlength attribute to the tag.static StringValidatorexactLength(int length)Works likeStringValidator.exactLength(int)but the returned validator is also adding maxlength attribute to the html tag.static StringValidatorlengthBetween(int minimum, int maximum)Works likeStringValidator.lengthBetween(int, int)but the returned validator is also adding maxlength attribute to the html tag.static StringValidatormaximumLength(int maximum)Works likeStringValidator.maximumLength(int)but the returned validator is also adding maxlength attribute to the html tag.
-
-
-
Field Detail
-
MAX_LENGTH
public static final String MAX_LENGTH
"maxlength" standard html input attribute name- See Also:
- Constant Field Values
-
-
Method Detail
-
addMaxLengthToTag
public static void addMaxLengthToTag(Component component, ComponentTag tag, int maxLength)
Adds a maxlength attribute to the tag.- Parameters:
component- owning wicket componenttag- tag to add tomaxLength- attribute value
-
exactLength
public static StringValidator exactLength(int length)
Works likeStringValidator.exactLength(int)but the returned validator is also adding maxlength attribute to the html tag.- Parameters:
length- the required length of the string- Returns:
- the requested
StringValidator
-
lengthBetween
public static StringValidator lengthBetween(int minimum, int maximum)
Works likeStringValidator.lengthBetween(int, int)but the returned validator is also adding maxlength attribute to the html tag.- Parameters:
minimum- the minimum length of the stringmaximum- the maximum length of the string- Returns:
- the requested
StringValidator
-
maximumLength
public static StringValidator maximumLength(int maximum)
Works likeStringValidator.maximumLength(int)but the returned validator is also adding maxlength attribute to the html tag.- Parameters:
maximum- the maximum length of the string- Returns:
- the requested
StringValidator
-
-