Skip to Content
0
Jul 03, 2020 at 09:57 AM

Display name attribute value for dynamic Enum type in backoffice

509 Views

Hello there,

I am trying to display name attribute value for a dynamic enum of type HybrisEnumValue in backoffice but since the enum definition doesn't have getter method for name it doesn't shows name instead PK is rendered of the object. If I do same thing for code it works fine. Below is my code snippet with which I am trying to see name attribute value is my base view for an enum SalesOrganizationEnum which is subtype of HybrisEnumValue

<context type="SalesAreaStructure" component="base" merge-by="type">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
<y:labels>
<y:label>salesGroup.salesOrganization.name+ ' ' +salesGroup.distributionChannel</y:label>
</y:labels>
</y:base>
</context>

On one answer I read we can defined a property with pattern type.<EnumClassName>.<enumCode>.name=Localized Name in our locales properties file of our custom extenstion but this is not a feasible solution as my enum is dynamic and I don't have predefined set of codes and localized names which I can defined in properties and do server restart.

Any suggestions are highly appreciated.