Re: Recommended validation method

2008-10-19 Thread Igor Vaynberg
public class mywebpage extends webpage {
  @SpringBean private Dao dao;

  public mywebpage() {
 add(new textfield("foo").add(new ivalidatior() {
 public void validate(ivalidatable v) {
string value=v.getvalue();
if (!dao.valueunique(value)) {
 validatable.error(new
validationerror().addmessagekey("error.unique").setvariable("value",
value));
}}):}

thats all there is to it

-igor

On Sun, Oct 19, 2008 at 8:34 PM, claym <[EMAIL PROTECTED]> wrote:

>
> I'm fairly new, so help me out here...
>
> I've got a basic "register a user" form.
>
> I'd like to validate a couple of the fields (email, username) against the
> database.
>
> Database access provided by a @SpringBean service/dao object.
>
> Where/how is the recommended way of doing this type of validation? In the
> onSubmit? Some sort of custom validator?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/Recommended-validation-method-tp20062724p20062724.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Recommended validation method

2008-10-19 Thread claym

I'm fairly new, so help me out here...

I've got a basic "register a user" form.

I'd like to validate a couple of the fields (email, username) against the
database.

Database access provided by a @SpringBean service/dao object.

Where/how is the recommended way of doing this type of validation? In the
onSubmit? Some sort of custom validator?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Recommended-validation-method-tp20062724p20062724.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]