cancel after uploading file

when I upload a file and make some validation on the other attributes of the entity with showing validation messages of validation feedback on them (where entity inherits the file document ). upload file required field are not filled--->showing validation errors on the related members press cancel button-->but the object will be saved and refreshed in the data-grid. Is it bug? or I missed something.
2 answers

Mohammad, can you reproduce this in a test project and submit it to MXDN?

I suspect that the case you are running into has to do with the fact that binary/file uploads bypass the XMLHTTPRequest system that all other changes go through.

File uploads are performed via a form in an iframe using traditional form submission. This is how all AJAX frameworks handle them. The technical reason for this is that from the JavaScript environment in the browser it is impossible to access the local filesystem and the browser implementation makes an exception for handling the input type=file form element. This is a security requirement (the sandbox) for isolating web interactions from the local environment. A file comes from the local environment and interaction with files in a browser environment only happens with special cases and special API calls. Which is why file uploads bypass the regular sending of changed attributes of objects.

The Mendix web client also disassociates changes to a specific instance in order to handle multiple 'edit/view' forms that operate on the same instance simultaneously.

There is probably a parallel requirement collision when uploading a file with non-valid attribute values.

If you can reproduce this in a test project and submit it to MXDN we can verify this case and figure out how to handle it appropriately (if my guess is correct).


Yes Michiel I sent already a test project to MXDN, where the same problem(commit) happens even after uploading file and pressing on micro-flow button that is empty and has nothing to do