cancel
Showing results for 
Search instead for 
Did you mean: 

How can I render a an attribute of a child in editor area of product cockpit

0 Kudos

For the same type we have code as below:

For list view

  <context merge-by="type" parent="GenericItem" type="PartFitsModel" component="listview">
         <list-view:list-view>
             <list-view:column qualifier="product"/>
              <list-view:column qualifier="modelJd.name"/> 
              <list-view:column qualifier="modelJd"/> 
             <list-view:column qualifier="comment"/>
         </list-view:list-view>
     </context>

For editor area

 <context merge-by="type" parent="GenericItem" type="PartFitsModel" component="editor-area">
         <editorArea:editorArea name="">
         <editorArea:essentials>
                 <editorArea:essentialSection name="hmc.essential">
                     <editorArea:attribute qualifier="product"/>
                     <editorArea:attribute qualifier="modelJd.name"/>
                 </editorArea:essentialSection>
          </editorArea:essentials>
 </context>

But the modelJd.name doesnot work for editor area.

modelJd is a type in partFitsModel, and name is an attribute in modelJd type. It works with listview but not with editor area. Should I have to write a renderer.

Accepted Solutions (1)

Accepted Solutions (1)

former_member620692
Active Contributor
0 Kudos

Hi - please try the following:

 <context ....>
     ...
     ...
     <editorArea:essentials>
         <editorArea:essentialSection name="hmc.essential">
             <editorArea:attribute qualifier="product"/>
             <editorArea:attribute qualifier="modelJd"/>
         </editorArea:essentialSection>
     </editorArea:essentials>
     ...
     ...
 </context>
 
 <context type="ModelJd" component="base">
     <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
         <y:labels>
             <y:label>name</y:label>
         </y:labels>
     </y:base>
 </context>

You can check https://answers.sap.com/questions/12759433/how-to-display-relational-attribute-in-list-view-o.html?c... for an example.

Answers (1)

Answers (1)

0 Kudos

Hi ,

Please try below snippet of code.

 <context merge-by="module" parent="GenericItem" type="modelJd" component="base" module="cockpit">
          <y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
              <y:labels>
                  <y:label>name</y:label>
              </y:labels>
          </y:base>
     </context>