on ‎2021 Apr 11 12:51 PM
Hello,
I'm new with SAP Commerce and i have this problem:
i have the following relation:
<relation code="Cooperative2PointOfService" autocreate="true" generate="true" localized="false">
<sourceElement qualifier="cooperative" type="Cooperative" cardinality="one">
<modifiers optional="false" initial="true"/>
</sourceElement>
<targetElement qualifier="pointOfService" type="PointOfService" cardinality="many">
<modifiers partof="true"/>
</targetElement>
</relation>
So in the backoffice-config.xml for the Cooperative's backoffice page i display the PointOfService list in this way:
<context merge-by="type" type="Cooperative" component="listview">
<list-view:list-view xmlns:list-view="http://www.hybris.com/cockpitng/component/listView">
<list-view:column qualifier="pointOfService"/>
</list-view:list-view>
</context>
<context type="pointOfService" component="base">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
<y:labels>
<y:label>pointOfService</y:label>
</y:labels>
</y:base>
</context>
The problem is that in this way i display the list of the pointOfServiceModel(pk) like following screenshot:

But i would like to display the attribute pointOfService.name.
I've already tried to wrtite "pointOfService.name" instead of "pointOfService" in both xml components but this does not work....

Anyone can tell me the rigth way to show pointOfService.name in the list view?
Thank you for help.
Request clarification before answering.
Hi Brunato,
Already label is available for PointOfService in basecommercebackoffice-backoffice-config.xml
<context type="PointOfService" component="base" merge-by="type" parent="GenericItem">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
<y:labels>
<y:label>name</y:label>
</y:labels>
</y:base>
</context>
We have another option with cell renderer spring-bean configuration. You can check OOTB
AbstractMedia syncStatus attribute list view configuration.
<list-view:columnqualifier="syncStatus" spring-bean="syncStatusCellRenderer" label="syncstatus.column.label"/>
or
StandardCurrencyListViewRenderer
<list-view:columnqualifier="totalPrice"spring-bean="standardCurrencyListViewRenderer"/>
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had a similar problem (1:n relation between productchangelog and product) and solved it like this in our extensions' backoffice config xml:
<context merge-by="type" type="ProductChangeLog" component="base" parent="GenericItem">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
<y:labels>
<y:label>modifiedtime + ' - ' + @labelService.getObjectLabel(product)</y:label>
</y:labels>
</y:base>
</context>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.