You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bart Molenkamp <b....@bizzdesign.nl> on 2006/11/23 09:22:45 UTC

WidgetValidator can't access upload's value if it was invalid on previous submit

Hi,

Why does Upload.getValue() first check if it's valid, and if not, simply
returns null? This is a problem for validators that want to access the
uploaded file (the Part instance).

If I have a required upload field, then submit the form (without
uploading any file), the upload widget is invalid (which is correct).
Then, when I select a file and submit again (the file will be uploaded)
I can't access the part in my validator, as the Upload widget is still
invalid. Should there be an alternative method for accessing the part,
that doesn't check if the upload widget is valid?

This isValid() check before returning the Part is introduced after
2.1.5.

Thanks,
Bart.