Using ListValue Pluggable Widget Props

1
Hi everyone, in 8.7 the ListValue was introduced for the datasource property. Now this returns the GUID of list objects only. Does anyone of you see, how this can still be used to build for example a custom dropdown list? How can domain object properties be accessed from Pluggable Widgets using the GUID?
asked
3 answers
1

The basic problem here is that you somehow have to tell React which attribute of the entity to use as content in the dropdown.

I guess for your use case the best solution is to use an additional property of type attribute.
What this gives you is a function that maps from the GUIDs to an attribute value.
You could then use that value in your dropdown.

 

https://docs.mendix.com/apidocs-mxsdk/apidocs/property-types-pluggable-widgets#attribute

answered
0

Thx, for the idea. Still sounds to me like a quite complex solution for a problem that should be simple. I hoped that it would have become more straightforward. My current solution is to serialize the options to a key-value json array and use that. Guess I’ll stick to that for the time being.

answered
0

You can use the client API to retrieve the list of objects based on an array of guids

documentation

mx.data.get({
    guids: [ "123456", "456789" ],
    callback: function(objs) {
        console.log("Received " + objs.length + " MxObjects");
    }
});

 

answered