try adding it before validation - i copy+paste my code (which works in
production)
final TextField website = new
TextField("profiles.contactProfile.website")
{
private static final long serialVersionUID = 1L;
// add http:// if missing
@Override
protected void convertInput() {
String input = getInput();
if (input != null && !Strings.isEmpty(input) &&
!(input.startsWith("http://") || input.startsWith("https://"))) {
setConvertedInput("http://" + input);
} else {
setConvertedInput(Strings.isEmpty(input) ? null : input);
}
}
};
Sergey Podatelev wrote:
>
> Okay, I'm sorry, that was a bad question.
> Validators shouldn't do anything but validation anyway.
>
> But a way to allow validator to skip protocol-less strings, i.e.
> "google.com"
> instead of "http://google.com"?
>
> On Thu, Jul 17, 2008 at 11:04 AM, Sergey Podatelev <
> [EMAIL PROTECTED]> wrote:
>
>> Is there a way to configure URLValidator to automatically append the
>> "http://" string to provided value in case it's otherwise correct, but no
>> protocol notation is present?
>>
>> --
>> sp
>>
>
>
>
> --
> sp
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/URLValidator-to-auto-append-%22http%3A--%22-tp18502724p18533599.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]