on 2016 Jul 27 8:48 AM
I have two items, ItemA and ItemB and there is one to many relation between them. I have a requirement to display the attribute of ItemB in ItemA.
<itemtype code="ItemA"
jaloclass="com.xyz.core.staff.jalo.StaffInformation">
<deployment table="staffinformation" typecode="20707" />
<attributes>
<attribute type="java.lang.String" qualifier="name">
<modifiers optional="false" />
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
<itemtype code="ItemB" extends="AbstractContactDetails"
jaloclass="com.xyz.core.contact.jalo.EContactInfo">
<attributes>
<attribute type="java.lang.String" qualifier="emailAddress">
<modifiers unique="true" />
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
<relation code="ItemAToItemB" autocreate="true"
generate="false" localized="false">
<sourceElement qualifier="itemA" type="ItemA"
cardinality="one">
<modifiers />
</sourceElement>
<targetElement qualifier="itemB" type="ItemB"
cardinality="many">
<modifiers partof="true" />
</targetElement>
</relation>
So i need to display emailAddress in list view of ItemA
I tried accessing attribute through qualifier of targetElement i.e itemB.emailAddress and also tried giving base config for ItemB.
But it didnt worked. Please Suggest
Thanks,
Hi All, If you want to fetch the value from other type other than the context one then, you may have to write renderer class to fetch the value of that attribute. For instance in above code you have to write one java class which implements WidgetComponentRenderer and the spring name can be used to define that
<list:list-view xmlns:list="http://www.hybris.com/cockpitng/component/listView">
<list:column qualifier="name">
<list:column qualifier="emailAddress" spring-bean="emailAddressRenderer" label="Email Address" />
</list:list-view>
</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 |
---|---|
12 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
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.