The rawInput variable is set in the FormComponent when the validation
starts.  If validation succeeds, rawInput is set to an internal constant and
processing continues.  If validation fails, the rawInput for each
FormComponent is still available and is rendered on the input page.

As far as adding an IntegerValidator to a TextField, it's pretty simple:

TextField age = new TextField("age");
age.add(IntegerValidator.range(0, 130));
add(age);

The last call adds the TextField to the Form object.


Nick, Wicket does look interesting, but I'm curious, how does Wicket
> handle preserving the user's form input when you need to return the user
> back to the form when validation fails? For example, if my eventual POJO
> needs to accept an Integer "age" but the user enters in  34f6 for age on
> the JSP form, how does Wicket handle this?
>

Reply via email to