on 2020 Nov 18 5:49 PM
Hello experts,
We are trying to hide some sections in a tab dynamically based on certain conditions. In the csbackoffice, if we search for an order and opened the order details tab we have many sections displayed, for example if the order is a shipping/instorepickup order, hide/show the line details section.
Is there a way to do hide the sections dynamically? Any pointers would be helpful.
Request clarification before answering.
To hide the Section dynamically you need to Extend the Renderer that is used for the Tab and set the new Renderer explicitly on this specific Tab.
Therefore Extend :
DefaultEditorAreaTabRendererI would suggest adding the option to configure the behavior based on editor-parameters to be more dynamic.
Example on the Attributes Tab on the Product Editor-Area we modified, to have one Classification System in one Tab.
<editorArea:customTab name="hmc.tab.attribute" position="4"
spring-bean="myEditorAreaTabRenderer">
<editorArea:render-parameter>
<editorArea:name>MYParam</editorArea:name>
<editorArea:value>MyParamValue<editorArea:value>
</editorArea:render-parameter>
</editorArea:customTab>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi stefankruk , thanks for the help!.
Quick question Stefan,
Is it possible to extend DefaultEditorAreaTabRenderer class because i want to call render method in it from extended class?.
I tried this but it is leading to an infinite loop.
Basically I want to hide some sections based on type of data (OrderModel) loading into editor.
Here is code snippet from my extended class:
@Override
public void render(Component parent, AbstractTab configuration, Object data, DataType dataType,
WidgetInstanceManager widgetInstanceManager) {
for (final AbstractSection section : ((Tab) configuration).getCustomSectionOrSection()) {
if (hideSectionBasedOnSection(section.getName(), data)) {
section.setName("");
}
}
super.render(parent, configuration, data, dataType, widgetInstanceManager);
for (final AbstractSection section : ((Tab) configuration).getCustomSectionOrSection()) {
if (hideSectionBasedOnSection(section.getName(), data)) {
section.setName("");
}
}
}
Thanks
Ram
I've Updated my Answer above. I told you the wrong DefaultEditorAreaTabRenderer. The right one would be DefaultEditorAreaRenderer it seems.
The best would be to replace the whole render Method
| 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.