Skip to Content

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

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 01, 2019 at 05:19 PM

    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?childToView=12803975#answer-12803975 for an example.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 01, 2019 at 07:02 PM

    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>
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.