Why was file upload support removed for Pluggable Widgets?
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?
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: