You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ayodeji Aladejebi <al...@gmail.com> on 2008/06/30 12:08:20 UTC

Converters and Validators

Hi,
I want to know if this is the right thing to do if a value required
conversion

Textfield dateField = new TextField("date", Date.class);

dateField.add(new DateBeforeAnotherDateValidator());

class DateBeforeAnotherDateValidator{
 protected void onValidate(IValidatable validatable) {
        Date choosenDate = (Date) validatable.getValue(); //will this cast
work
    }
}

Are converters invoked before validators. can I do this

thanks

Re: Converters and Validators

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Mon, 30 Jun 2008, Ayodeji Aladejebi wrote:
> Are converters invoked before validators. can I do this

raw input
  conversion -> converted input, if conversion succeeds
      validation -> modelObject update, if validation succeeds

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Converters and Validators

Posted by Ayodeji Aladejebi <al...@gmail.com>.
yes this works well. thanks

On Mon, Jun 30, 2008 at 11:08 AM, Ayodeji Aladejebi <al...@gmail.com>
wrote:

> Hi,
> I want to know if this is the right thing to do if a value required
> conversion
>
> Textfield dateField = new TextField("date", Date.class);
>
> dateField.add(new DateBeforeAnotherDateValidator());
>
> class DateBeforeAnotherDateValidator{
>  protected void onValidate(IValidatable validatable) {
>         Date choosenDate = (Date) validatable.getValue(); //will this cast
> work
>     }
> }
>
> Are converters invoked before validators. can I do this
>
> thanks
>