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

How to remove attribute from administration tab in backoffice?

Former Member
0 Likes
3,874

I try to remove in backoffice-config from administration tab attribute by:

 <context merge-by="module" type="Warehouse" component="editor-area">
         <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="stockLevels" readonly="true"  merge-mode="remove"/>
                 </editorArea:customSection>
             </editorArea:tab>
         </editorArea:editorArea>
     </context>

merge-mode="remove" set on section or tab causes that these parts are removed. It didn't work on attribute.

Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor

Please try the following code:

 <context merge-by="module" type="Warehouse" component="editor-area" module="basecommercebackoffice">
     <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:section name="hmc.section.stocklevel.stock">    
                      <editorArea:attribute qualifier="stockLevels" merge-mode="remove"/>
                 </editorArea:section>
         </editorArea:tab>
     </editorArea:editorArea>
 </context>

You have missed two things:

  1. module="basecommercebackoffice" in the first line

  2. <editorArea:section name="hmc.section.stocklevel.stock">...</editorArea:section>

Answers (2)

Answers (2)

Former Member
0 Likes

, , Thanks for you answers. , your code works of course, but I focus deeper on this particular problem and found out different issues with this. , part of your answer (

configure EditorArea in the way that stockLevels are displayed somewhere else (then it will not be rendered in Unbound section)

) was really helpful.

During testing your solution it occured that field "stockLevels" is overridden by custom editor for stockLevels (it came from hybris platform) in first tab hmc.properties, but with qualifier baseStores. Please note, that in base hybris configuration there are two different editors with the same baseStore qualifier.

 <editorArea:tab name="hmc.properties">
             <editorArea:section name="hmc.section.warehouse.basestores">
                 <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" editor="com.hybris.cockpitng.editor.extendedmultireferenceeditor" qualifier="baseStores">
                     <editorArea:editor-parameter>
                         <editorArea:name>listConfigContext</editorArea:name>
                         <editorArea:value>referenceListView</editorArea:value>
                              </editorArea:editor-parameter>
                          </editorArea:attribute>
             </editorArea:section>
             <editorArea:section name="hmc.section.warehouse.stocklevels">
                 <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" editor="de.hybris.platform.commerceservices.backoffice.editor.stocklevelfindereditor" label="hmc.text.warehouse.usesearchtogetstocklevels" qualifier="baseStores">
                     <editorArea:editor-parameter>
                         <editorArea:name>stockLevelSearchField</editorArea:name>
                         <editorArea:value>warehouse</editorArea:value>
                              </editorArea:editor-parameter>
                          </editorArea:attribute>
                      </editorArea:section>
         </editorArea:tab>


Consequently I removed the wrong pnd added the proper one. This also fix my problem:

   <editorArea:section name="hmc.section.warehouse.stocklevels">
                     <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea"
                                           editor="de.hybris.platform.commerceservices.backoffice.editor.stocklevelfindereditor"
                                           label="hmc.text.warehouse.usesearchtogetstocklevels"
                                           qualifier="stockLevels">
                         <editorArea:editor-parameter>
                             <editorArea:name>stockLevelSearchField</editorArea:name>
                             <editorArea:value>warehouse</editorArea:value>
                         </editorArea:editor-parameter>
                     </editorArea:attribute>
                 </editorArea:section>
                 <editorArea:section name="hmc.section.warehouse.stocklevels">
                     <editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea"
                                           editor="de.hybris.platform.commerceservices.backoffice.editor.stocklevelfindereditor"
                                           label="hmc.text.warehouse.usesearchtogetstocklevels"
                                           qualifier="baseStores" merge-mode="remove"/>
                 </editorArea:section>





former_member625836
Active Contributor
0 Likes

Hi ,

unboudSectionRenderer works this way: it takes whole EditorArea configuration, gathers all attributes configured there and removes them from all attributes available for the type. A set of attributes being a result of this subtraction is then rendered. The removal that you are trying to use (although reasonable) will not work. You have multiple possibilities to go with (depending on your requirements):

  1. configure EditorArea in the way that stockLevels are displayed somewhere else (then it will not be rendered in Unbound section)

  2. set hiddenForUI for stockLevels on attribute level to true (then it will not be visible in Backoffice at all)

  3. provide your own implementation of unboundSectionRenderer and disable rendering it there

Cheers, Jacek

former_member632827
Participant
0 Likes

Hi , I want to remove the PK attribute from the Metadata section in the administration tab. How can do?