Why was file upload support removed for Pluggable Widgets?

0
I’ve developed a custom pluggable (React) widget that records and plays audio but I can’t save the audio data (blob) directly to a System.FileDocument because there is no upload feature anymore. Why was this removed in Pluggable Widgets (React)? It was available in Custom Widgets (Dojo) with the mx.data.SaveDocument method. Is there any way to access SaveDocument in a pluggable widget? I see from the File Dropper widget code that FileDropper.tsx calls a saveDocument method imported from @jeltemx/mendix-react-widget-utils/lib/documents and that the saveDocument method in documents.ts calls mx.data.SaveDocument in the Mendix client API. I tried npm installing @jeltemx/mendix-react-widget-utils and mimicking what Jelte Lagendijk did in FileDropper.tsx but I run into errors complaining about the entity type property not being available in a pluggable widget. I’m wondering what magic Jelte performed to create his React widget. I can see that the <widget tag is defined differently than a standard pluggable widget. All this would be much easier if pluggable widgets had access to a file upload API. Any suggestions?  
asked
1 answers
0

Hi Lauren,

There are 2 ways of building widgets, the old way names custom widgets and the new way pluggable widgets.

The new way is till in development has not reached parity however the API is more powerful. see:  

https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets#2-differences-between-pluggable-and-custom-widgets So it was not removed… just not jet added

I hope they will add file upload support soon… but did not hear anything on the roadmap.

The magic Jelte used, he combined React with the old API. 

Some workaround used for files (if they are not to big) is to convert the file into base64 and set it as a value in in a string attribute of the object. On the server side convert it to a file.

Cheers, Andries

answered