On 7/17/07, Fisher, Brice A <[EMAIL PROTECTED]> wrote:
>
> An additional question. Trying to do things the "brute force way", I
> implemented the following in my form:
>
>
> @Override
> protected void validate() {
> Button b = findSubmittingButton();
> if (b == updateButton) {
> super.validate();
>
> // Additional validations...
> } else {
> updateFormComponentModels();
> }
> }
>
>
> If the "else" branch is taken, then the fields from the form are null.
> If I switch my RequiredTextFields to TextFields and force the "if"
> branch, then the form fields are correctly populated. So, apparently
> there is more happening in super.validate() than is covered by
> updateFormComponentModels().
>
> However, if I look at super.validate(), it includes:
>
> validateRequired();
> validateConversion();
> validateValidators();
> validateFormValidators();
>
> None of which are available in the inherited class.
>
> So, should I plan on re-implementing the contents of one or more of
> these functions in my class or is there another method I can call to
> correctly populate the form elements?
you cannot update models without validation. a simple example:
you have TextField("number", Integer.class); and the user enters "a".
obviously you cannot put "a" into a model that expects an Integer.
-igor
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user