Re: Upload component in onValidate

2009-08-14 Thread Ulrich Stärk
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

RE: Antwort: Re: Upload component in onValidate

2009-08-14 Thread Newham, Cameron
>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

Re: Antwort: Re: Upload component in onValidate

2009-08-14 Thread Stephan Windmüller
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

Re: Upload component in onValidate

2009-08-14 Thread Stephan Windmüller
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

Antwort: Re: Upload component in onValidate

2009-08-14 Thread dirk . lattermann
> 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

Re: Upload component in onValidate

2009-08-14 Thread Otho
>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

Upload component in onValidate

2009-08-14 Thread 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; | | [...] | | void onValidate() { | | if(file.getContentType().toLowerCase(Locale.ENGLISH) |