onValidate() gets called for every form component inside your form. The NullPointerException you are
getting is likely due to some other form component also validating. Change the method name to match
your upload component's id, e.g. onValidateFromUpload() if your component's id is upload. That
>From JumpStart for a Form it is:
pageAttached()
onActivate()
...onPrepareForSubmit()
...onPrepare()
...onSelected()
...onValidateForm()
...onSuccess()
...onSubmit()
...Tapestry creates a URL to next page
pageDetached()
...Tapestry redirects to render next page
-Original Message-
...
The
dirk.latterm...@bgs-ag.de wrote:
> So, in short, try using onValidateForm() instead of onValidate().
That solved my problem. Thank you very much for this simple solution!
Regards
Stephan Windmüller
-
To unsubscribe, e-mail: us
Otho wrote:
> From skimming the sources I would guess that you need to provide your own
> FieldValidator as a component parameter to
Thanks for the quick reply!
I wrote the FieldValidator, but where do I register it and how do I set
the component parameter?
gives me this error:
| Unknown val
> 2009/8/14 Stephan Windmüller
>
> > Hello!
> >
> > We are using the upload component of tapestry and want to validate the
> > content type during the upload. To accomplish this we wrote the
> > following code:
> >
> > | @Property
> > | private UploadedFile file;
> > |
> > | [...]
> > |
> > | voi
>From skimming the sources I would guess that you need to provide your own
FieldValidator as a component parameter to
2009/8/14 Stephan Windmüller
> Hello!
>
> We are using the upload component of tapestry and want to validate the
> content type during the upload. To accomplish this we wrote
Hello!
We are using the upload component of tapestry and want to validate the
content type during the upload. To accomplish this we wrote the
following code:
| @Property
| private UploadedFile file;
|
| [...]
|
| void onValidate() {
|
| if(file.getContentType().toLowerCase(Locale.ENGLISH)
|