paste clipboard

0
Hi,   We want to save images (and documents) from clipboard. Does anyone know a sollution on how to do this? You can copy printscreen to a Rich Text field, but we want to save the image as an image directly to the entity. And if it is possible we also want this for documents.   Kind regards, Steven Keersmaekers
asked
1 answers
1

Hi Steven,

Since it does not look like Mendix Marketplace/App Store has any widget for this, it may be necessary for you / someone else to create such widget that can allow storing images on paste from your clipboard.

 

Although this requires a fair amount of knowledge in programming in JavaScript/similar languages that Mendix supports for making widgets.

Here are some links to get started with writing code that can get the image from your clipboard when pasting:

https://ourcodeworld.com/articles/read/491/how-to-retrieve-images-from-the-clipboard-with-javascript-in-the-browser

https://jsfiddle.net/ourcodeworld/hzvfq82b/

These are for images, but files/documents should also be possible to obtain :-)

To store file data to a FileDocument (or a sub-entity of it): https://apidocs.rnd.mendix.com/8/client/mx.data.html#.saveDocument

 

Additionally, you can find documentation to get started with writing Mendix widgets here:

https://docs.mendix.com/howto8/extensibility/widget-development

https://github.com/mendix/AppStoreWidgetBoilerplate

There’s also pluggable web/native widgets now, but it is not something I have worked with.

 

I hope this helps you,

Andreas

answered