on ‎2018 Dec 04 10:02 AM
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.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
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:
module="basecommercebackoffice" in the first line
<editorArea:section name="hmc.section.stocklevel.stock">...</editorArea:section>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
, , 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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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):
configure EditorArea in the way that stockLevels are displayed somewhere else (then it will not be rendered in Unbound section)
set hiddenForUI for stockLevels on attribute level to true (then it will not be visible in Backoffice at all)
provide your own implementation of unboundSectionRenderer and disable rendering it there
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 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.