the modelobject of fileuploadfield is of type FileUpload not the filename
string, so you cant use a validator that expects a string.

you should do this check in your onsubmit handler.

-igor


On 10/14/07, Voronetskyy <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm neophyte of Wicket...
>
> I'am using PatternValidator to test file name in the upload component.
> I wrote the code :
>
> private class FileUploadForm extends Form
>     {
>         private FileUploadField fileUploadField;
>         public FileUploadForm(String name)
>         {
>             super(name);
>             setMultiPart(true);
>
>             add(fileUploadField = new FileUploadField("fileInput"));
>
>             fileUploadField.add(new
> PatternValidator(Pattern.compile("^*.JPG$")));
>         }
> // some  code
> }
>
> When submiting form with any file name, like 'D:\foto\alena.JPG' that
> matches my mask "^*.JPG$", I have a message that my file name is not
> matching the mask.
>
> Can anyone tell me what is wrong with my code.
>
> Thank you in advance for your help,
> Yevgen.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to