You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Blank <ro...@s2003.tu-chemnitz.de> on 2006/08/24 12:42:27 UTC

Problem with UploadWidget Validation

Hello,

I have a problem with the validation of an UploadWidget. I use a 
SelectionWidget with two entries: "a" and "b". If "a" is selected i do 
not validate the UploadWidget. If "b" is selected the UploadWidget have 
to be NOT null.
Here the script for that:

UploadWidget.setValidationError(null);
if (SelectionWidget.value == "b") {
   if (UploadWidget.value == null) {
     UploadWidget.setValidationError(new ValidationError("Upload a 
file!", false));
   }
}

The problem is: If i select "b" and do not upload any file, i get the 
ValidationError as expected when i try to save the Form. After that I 
select "a" and want to save the Form, but the Form will not be saved. 
Only the ValidationError disappears. If I want to save again, it works.

I tried the same with a normal "StringWidget" and there it works.

Can anyone help me?


Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Problem with UploadWidget Validation

Posted by Robert Blank <ro...@s2003.tu-chemnitz.de>.
Robert Blank schrieb:
> Hello,
> 
> I have a problem with the validation of an UploadWidget. I use a 
> SelectionWidget with two entries: "a" and "b". If "a" is selected i do 
> not validate the UploadWidget. If "b" is selected the UploadWidget have 
> to be NOT null.
> Here the script for that:
> 
> UploadWidget.setValidationError(null);
> if (SelectionWidget.value == "b") {
>   if (UploadWidget.value == null) {
>     UploadWidget.setValidationError(new ValidationError("Upload a 
> file!", false));
>   }
> }
> 
> The problem is: If i select "b" and do not upload any file, i get the 
> ValidationError as expected when i try to save the Form. After that I 
> select "a" and want to save the Form, but the Form will not be saved. 
> Only the ValidationError disappears. If I want to save again, it works.
> 
> I tried the same with a normal "StringWidget" and there it works.
> 
> Can anyone help me?
> 
> 
> Robert

Any Ideas?!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org