Not sure what to do with the widget attribute property.

There isn't very comprehensive documentation on writing widgets for Mendix. In my XML I define the following property: <property key="domainname" type="attribute" required="true" isPath="optional" pathType="reference"> ...which is a string value etc. But client-side, when I output the value of domainname, I get the association [entity/association/attribute] path. Not sure how to get my hands on the actual value?
1 answers

Javascript doesn't use any sort of classes or object-types. It mostly handles in strings.

The string you get can be used together with an object to get the actual value. You can use obj.get(domainname) to retrieve the value.

MxObject - Get function


Retrieving attributes over an association is trickier. You need to separate the association part, use that with obj.getChild(assocname) and use that object to get the 3rd part of the association.

You can use domainname.split("/") and use split[1] for the association and split[2] for the attribute part. Note that this only works for 1-deep association but that is the only one supported anyway.

You can take a look at the Format String widget for an example. It uses the GetEverything function I've mentioned earlier in a different Forum question.