cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how can we hide products unbound sections attributes

Former Member
0 Likes
2,479

Hi , I am trying to hide the attributes from Products->Administraction ->Unbound section attributes fields by referring the below link but it is not working. Kindly let know if anyone have idea. https://answers.sap.com/questions/12770546/how-to-remove-attribute-from-administration-tab-in.html

     <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
         <editorArea:tab name="hmc.administration">
             <editorArea:customSection name="hmc.unbound" spring-bean="unboundSectionRenderer">
                 <editorArea:attribute qualifier="productListComponents" merge-mode="REMOVE"/>
     </editorArea:customSection>
         </editorArea:tab>
     </editorArea:editorArea>
 </context>


Accepted Solutions (0)

Answers (5)

Answers (5)

arvind-kumar_avinash
Active Contributor

You have missed merge-mode="remove" in the following line:

 <editorArea:customSection name="hmc.unbound" spring-bean="unboundSectionRenderer">

It should be like the following in order to hide the section:

 <editorArea:customSection name="hmc.unbound" spring-bean="unboundSectionRenderer" merge-mode="remove" />

Please note that you can hide the attribute from backoffice by adding custom-properties with hiddenForUI for the attribute in items.xml. Given below is an example from core-items.xml:

 <attribute autocreate="true" qualifier="taxValuesInternal" type="java.lang.String" generate="true">
     <custom-properties>
         <property name="hiddenForUI">
             <value>Boolean.TRUE</value>
         </property>
     </custom-properties>
     <persistence type="property"/>
     <modifiers read="true" write="true" search="false" optional="true"/>
 </attribute>

Please make sure to run ant all and perform system update after making change in items.xml.

former_member625836
Active Contributor
0 Likes

Hi ,

A trick with merge-mode="remove" is a nice one, yet will not work (you can take a look at com.hybris.cockpitng.widgets.editorarea.sections.UnboundSectionRenderer to see how this renderer works exactly.

I do like an approach with hiddenForUI - this is the way you should go. If it doesn't work for you, I would expect some error with your implementation. To make sure that property was set, you may go to System -> Types, select your type, find your attribute and check if property is set properly. You may also get to the same point using an impex that would set hiddenForUI to true on specified AttributeDescriptor.

Last reasonable approach I see, is to override UnboundSectionRenderer#prepareUnboundConfiguration and remove from the result those, that you don't want. Then you just need to register it as a new Spring bean and use it in EditorArea configuration for your type.

Cheers, Jacek

mirkopleli
Discoverer
0 Likes

Hi jawaw,

What would be the appropriate solution for relations?

Best regards,

Mirko Pleli

former_member625836
Active Contributor
0 Likes

mirkopleli ,

It's been quite some time since I last worked with Backoffice configuration, but I'd say that relations are just another attribute for Backoffice. You should be able to set `hiddentForUI` property for it. Even if it is not possible in `items.xml`, it should be doable via impex.

Cheers,

Jacek

Former Member
0 Likes

Yes.I run 1.ant clean all & hybrisServer.bat 2.System update and 3.reset everything as well.

Former Member
0 Likes

Thanks Arvid,

I have added code as below in myextensioncore-items.xml file and it didn't work , Could you please check and suggest if any issue.

                     <description>Average rating</description>
                     <modifiers read="true" write="true" optional="true" search="false"/>
                     <custom-properties>
                     <property name="hiddenForUI">
                         <value>Boolean.TRUE</value>
                     </property>
                 </custom-properties>
                     <persistence type="property" />
                 </attribute>
arvind-kumar_avinash
Active Contributor
0 Likes

Did you run ant all and perform system update after this change?

Former Member
0 Likes

Thanks Arvind,

When I keep merge-mode="remove" on section then the entire section itself getting hidden. I would like to hide few attributes in this section only.

      <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
      <editorArea:tab name="hmc.administration">
          <editorArea:customSection name="hmc.unbound" spring-bean="unboundSectionRenderer" merge-mode="REMOVE">
              <editorArea:attribute qualifier="productListComponents" merge-mode="REMOVE"/>
  </editorArea:customSection>
      </editorArea:tab>
  </editorArea:editorArea>