This can be done by using the MxModelReflection module from the app store. This provides the representation of all entities, associations, attributes and microflows.
Regarding your second question MxModelReflection is exactly what you need. Now in order to display a dropdown you can not use an enum (unless you want to hardcode the attributes for your entity there, which completely misses the point IOP if you want it to be dynamic and reusable for other entites). Instead you need to use a reference selector. This is how I would do it:
Make an association between your entity and the MxObjectMember entity and use the attribute "AttributeName" to select by. Use XPath constraint o only show attributes for the data view entity
If you want to avoid hardcoding the module and entity name, you need to use a java action to retrieve the name at runtime.
Hope this helps,
EDIT PS: In java you can get the CompleteName for an entity which consists of the module name.entity name e.g. "MyFirstModule.Employee" from an IMendixObject imo using
`imo.getType();` Make sure to pass "Any object" as parametar to your java action.
MxModelReflection only goes so far. You would need a custom solution to achieve what you want.
The simplest solution I can think of is to define another entity e.g. AttributeValue that holds the value for a specific attribute as a string. To get an attribute value as a string you can use the CommunityCommons library or write your own java action that just calls "toString()" or "parseValueToString()" on the appropriate attribute member.
Here is minimal working example to help you out:
Using a microflow as datasource was easiest for me to implement but you can choose a different approach, perhpas get all the values in a before commit attribute.
Here is a screenshot of the end result
And here is what I have selected to be shown.
I hope this helps,
PS; Here is the datasource microflow