added this class just now:
/**
* Validator for checking the form/pattern of email addresses.
*
* @author Chris Turner
* @author Jonathan Locke
*/
public class EmailAddressPatternValidator extends PatternValidator
{
/**
* Constructor
*/
public EmailAddressPatternValidator()
{
super("^[_a-z0-9-]+(\\.[_a-z0-9-]+)[EMAIL PROTECTED](\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$", Pattern.CASE_INSENSITIVE);
}
}
Jonathan Locke wrote:
ooooh. right a text field, not a label, duh.
you're correct that this should be a subclass of PatternValidator. i think it would be a smart thing to add to the core.
jon
Christopher Turner wrote:
Isn't an email text field just an ordinary text field with that uses a pattern validator to ensure that the supplied value is a correctly formatted email address?
I personally use this approach with the reg exp pattern
"^[_a-z0-9-]+(\\.[_a-z0-9-]+)[EMAIL PROTECTED](\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$"
E.g.:
TextField emailAddress = new TextField("emailAddress", myFormModel);
emailAddress.add(new PatternValidator("^[_a-z0-9-]+(\\.[_a-z0-9-]+)[EMAIL PROTECTED](\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$");
Perhaps we should add an EmailAddressValidator to the wicket core as this is such a common requirement?
Regards, Chris
>
> i think there's already a label component in wicket-extensions that
> makes email links happen automatically....
>
> [EMAIL PROTECTED] wrote:
>
> >Hello all,
> >It would be great to have eMail Field (emailTextField component) as
> >part of standard Wicket distribution.
> >What do the other users of the framework think?
> >Best Regards,
> >Les
> >
> >
> >
> >
> >-------------------------------------------------------
> >SF email is sponsored by - The IT Product Guide
> >Read honest & candid reviews on hundreds of IT Products from real
> >users. Discover which products truly live up to the hype.
> Start reading
> >now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click <http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click>
> >_______________________________________________
> >Wicket-user mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> > > >
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from
> real users. Discover which products truly live up to the
> hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396 <http://ads.osdn.com/?ad_id=6595&alloc_id=14396>> &op=click
>
> _______________________________________________
>
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/w> icket-user
>
>
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
