UploadControl isFilled vs isOk

3 years ago

michal.lohnisky
Member | 76
+
+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?

3 years ago

David Grudl
Nette Core | 6831
+
+1
-

+1