https://forum.mendix.com/link/ideas/117
You can use the mendix client api’s to retrieve the current object from the context.
var obj = context.getTrackObject();
obj.getGuid(); // "12345"
obj.get("attributeName"); // returns the value of the attribute
More information about the context in a widget can be found in the docs: