on ‎2019 Jan 08 7:10 PM
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>
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Yes.I run 1.ant clean all & hybrisServer.bat 2.System update and 3.reset everything as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
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.