Get attribute value using Metadata interface

Hi,

I am trying to get the value of an entity attribute through the metadata interface.
For example if I have a Person entity and a “name” attribute, I can navigate to the MetaProperty using

person.getMetaClass().getMetaClass().getPropertyPath(“name”).getMetaProperty();

How then can I get the actual value of the attribute from the MetaProperty?

Thanks

Hi, @Matthis

there is no need to use Metadata or MetaPropertyPath / MetaProperty to get a value of some field.

I suggest that you use the com.haulmont.chile.core.model.Instance#getValueEx method. Example:

String personName = person.getValueEx("name");

Regards,
Daniil.

Thank you very much Daniil!
That is indeed easy and will do exactly what I want. Great.

Glad to here. You are welcome!