Need simple file upload

Is it possible to do a simple upload of a file in a dataview, using a microflow button? All the samples I see have a grid of objects in between, but I want the user just be able to browse and save in the screen where he is editing the other attributes. Download is easy, there's a microflow action for that ;-) (BTW I use an entity CISDocument inherited from FileDocument, and associate with that)
3 answers

Have you tried using the file manager widget (default widget within the Mendix Business Modeler) in one of the cells in your dataview? You can set the behavior to "Both" so you can use it for both uploading and downloading a file.

Edit If you click on one of the entities in a grid, you can run a microflow which checks whether there is a CIS Document attached. If not, you can create the CIS Document entity and open a dataview popup where you can upload the file by using the file manager widget and save and close the form. If there is a CIS document found, you can either choose to replace it or create a new entity and association and end up with opening a form where the user can upload the file. Within your microflow you set the association with your CIS Document entity and the associated object from the grid without commit.


In order to hide the download button, you can use "edit visibility for this row" and make the table row conditionally visible based on attribute value "Has contents". Then you can show a download button when it has contents and an upload button when it has contents and no contents.


Ok, thanks, I managed to get what I want:

  • A dataview to the CISDocument containing the filemanager (only), nested in another dataview

  • New, edit and save microflow buttons who handle creating/destroying my CISDocument

There are new two new issues ;-)

In the filemanager:

  • When a file was previously uploaded, and I edit again, the file manager itself does not show the name of the upload.

    There is a gray box containing dots (...)

    I would like to see the file name here or have this box disappear. (I know I can show the file name separately if need be)

  • When no file was previously uploaded, the download button is still visible. It is only slightly grayer.

    Is there a way to make this button go away (maybe set the Filemanager.Type to upload?)