UploadControl isFilled vs isOk

Notice: This thread is very old.
michal.lohnisky
Member | 64
+
+10
-

Hi,

I suggest to distinguish error and filling FileUpload differently (changes are bold).

Situation Current solution My solution
File is not uploaded isOk() == FALSE, isFilled() == FALSE isOk() == FALSE, isFilled() == FALSE
File is succesfully uploaded isOk() == TRUE, isFilled() == TRUE isOk() == TRUE, isFilled() == TRUE
File is uploaded with error isOk() == FALSE, isFilled() == FALSE isOk() == FALSE, isFilled() == TRUE

In my form, fileUpload is not required, but if it's attached and error during upload arise, I want to give feedback to user. In current solution states “File is not uploaded” and “File is uploaded with error” are the same.

Is my logic better than current? Should I create a PR?

David Grudl
Nette Core | 8082
+
+1
-

+1