Pubggable widget get mxObj and name of Reference Entity

0
I am creating a file upload widget.I want to upload the file to an entity that generlization System.Image, and save it to a association.I'm having some problems 1. can't get name of Reference Entity,This leads to no way to use ClientAPI mx.data.saveDocument 2. can't get mxObj 
asked
3 answers
1

This is not available in a pluggable widget. Take a look at https://github.com/mendix/web-widgets/tree/main/packages/customWidgets

answered
0

Hi Xu, 

 

So if I understand correctly, you can't get the Mendix object in your code that is used to save your file? 

With mx.data.get you can retrieve any Mendix object you want, with parameters to specify your search ( for instance  a GUID, path or Xpath ). If you like to create a new object, you can use mx.data.create, and use that object to save your file. 

If you need any help, please provide a bit more information ( maybe a code snippet )  about your exact struggle. 

 

Best regards! Stefan. 

 

 

answered
0

I have uploaded the file to System.Image using mx.saveDocument

image.png

Now I want to associate this object with my current object

image.pngThis is a mistake. The object created by mx.data.create cannot be set by referenceSet.setValue

I also can't get the object of the current operation and set the reference through the clientAPI

image.png

answered