Re: EmailAddressValidator triggers on empty input field
Any idea? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3312795.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: EmailAddressValidator triggers on empty input field
Am 18.02.2011 15:39, schrieb hrbaer: Any idea? Did you check INullAcceptingValidatorT and AbstractValidatorT.validateOnNullValue() ? They discribe what is to do. Cheers Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: EmailAddressValidator triggers on empty input field
Right, but for this validator you are forced to use the singleton, which doesn't allow you to customize this feature. On Fri, Feb 18, 2011 at 9:53 AM, Mike Mander wicket-m...@gmx.de wrote: Am 18.02.2011 15:39, schrieb hrbaer: Any idea? Did you check INullAcceptingValidatorT and AbstractValidatorT.validateOnNullValue() ? They discribe what is to do. Cheers Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: EmailAddressValidator triggers on empty input field
I checked a little example and it worked as expected: - nothing in field ENTER results in All valid! - wrong email in field ENTER results in oops - valid email in field ENTER results in All valid! public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { FormVoid form = new FormVoid(form) { @Override protected void onSubmit() { System.out.println(All valid!); } @Override protected void onError() { System.out.println(oops); } }; TextFieldString email = new TextFieldString(email, new ModelString()); email.add(EmailAddressValidator.getInstance()); email.setRequired(false); form.add(email); add(form); } } html ?xml version=1.0 encoding=UTF-8 ? html xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; headtitleTitle/title/head bodyform wicket:id=forminput type=text wicket:id=email //form/body /html Right, but for this validator you are forced to use the singleton, which doesn't allow you to customize this feature. On Fri, Feb 18, 2011 at 9:53 AM, Mike Manderwicket-m...@gmx.de wrote: Am 18.02.2011 15:39, schrieb hrbaer: Any idea? Did you check INullAcceptingValidatorT and AbstractValidatorT.validateOnNullValue() ? They discribe what is to do. Cheers Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: EmailAddressValidator triggers on empty input field
Finally I got it. If you add setType( String.class ) to your TextField the EmailAddressValidator triggers on null/empty input. If you leave this everything works fine... I thought it would be useful to declare my inputfields as a certain type. Obviously it's not needed but also the outcome of this type is an error. Can anybody provide the sense of setting the type? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3313014.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: EmailAddressValidator triggers on empty input field
If you need anything else than string, integer for example its needed On Feb 18, 2011 5:14 PM, hrbaer herber.m...@gmail.com wrote: Finally I got it. If you add setType( String.class ) to your TextField the EmailAddressValidator triggers on null/empty input. If you leave this everything works fine... I thought it would be useful to declare my inputfields as a certain type. Obviously it's not needed but also the outcome of this type is an error. Can anybody provide the sense of setting the type? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3313014.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org