Need to distinguish between FileUpload's Empty Field and Bad File

2011-05-11 Thread eugenebalt
One final question on the FileUpload.

I need to differentiate between 2 kinds of errors (I display a different
message for each),

1) The FileUpload box is empty (i.e., nothing was typed in, and the Browse
button wasn't clicked),
2) The file does not exist (a filename was typed in, but that file does not
exist).

Both of these scenarios seem to be handled the same by Wicket: my Model is
NULL. It's NULL even if I type something in, as long as it's invalid.

(If my entry is valid, the Model then holds the FileUpload.)

So, is there a way to distinguish between empty field and file does not
exist, and have a way to catch both of these?

Thanks again

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Need-to-distinguish-between-FileUpload-s-Empty-Field-and-Bad-File-tp3515034p3515034.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Need to distinguish between FileUpload's Empty Field and Bad File

2011-05-11 Thread eugenebalt
Since no one's replied, I guess there's no way to distinguish.

Empty file box and invalid file are one and the same, and Wicket doesn't
expose that granularity.

I tried attaching a validator to the file box for an invalid file check
and also did setRequired(true) to check for blanks, and the validator never
even gets fired, it's always the Field Required error even if it's
non-blank. Oh well.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Need-to-distinguish-between-FileUpload-s-Empty-Field-and-Bad-File-tp3515034p3515681.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org