on 10-22-2018 11:39 PM
I tried the below configuration but did not help
<context type="Product" component="editor-area">
<editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
<editorArea:customTab name="hmc.tab.attribute" spring-bean="classificationTabEditorAreaRenderer" merge-mode="replace">
<editorArea:section name="hmc.section.product.untypedfeatures" merge-mode="replace">
<editorArea:attribute xmlns="http://www.hybris.com/cockpitng/component/editorArea" merge-mode="replace" qualifier="untypedFeatures" description="hmc.text.product.untypedfeatures" editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.wysiwyg)"/>
</editorArea:section>
</editorArea:customTab>
got it working with below configurations , hope this is the correct way
mybackoffice-spring.xml
`<!-- Editors -->
<cng:map-extender bean="editorRegistry" property="defaultEditorMapping">
<cng:put key-type="java.lang.String" value-type="java.lang.String">
<entry key="^FeatureValue\((.*)\)$" value="com.hybris.cockpitng.editor.myfeaturevalue"/>
</cng:put>
</cng:map-extender>`
Created a new Custom Editor similar to the FeatureValueEditor
and set the default editor in the render(Component parent, EditorContext context, EditorListener listener) method
subEditor.setDefaultEditor("com.hybris.cockpitng.editor.wysiwyg");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What a simple and therefore great solution!
For future reference, it looks like there is one common editor that wraps all feature values Feature Value Editor, and by modifying that editor, you can change what actual editor is used to edit the value
It's partially true what wrote (not possible by configuration only), but actually you can override the classificationTabEditorAreaRenderer bean, and it's method createEditor(), which will allow to show a different editor.
The class ClassificationTabEditorAreaRenderer indeed ignores any configuration, but this could be also overridden, by overriding the render() method, and put the 'configuration' parameter inside the widget's model. Then in the createEditor method we can get this config and read the 'editor' attribute.
We might capture this as an improvement, but the steps above should be sufficient to replace the classification editor.
Thanks, Marcin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@marcin.sulski
I am trying to extend ClassificationTabEditorAreaRenderer in my custom extension but not able to do the same and getting compile time error. My custom extesion has dependency on platformbackoffice extension. Error :
import de.hybris.platform.platformbackoffice.classification.ClassificationTabEditorAreaRenderer;
[yjavac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[yjavac] The import de.hybris.platform.platformbackoffice.classification cannot be resolved
I think it is because of the fact that ClassificationTabEditorAreaRenderer is in platformbackoffice_bof.jar which is inside resource/backoffice folder of platformbackoffice extension and not inside the lib folder and thus it can't be accesssed by other extensions even if they are depedent on platformbackoffice extension. Can you give some idea how to extend ClassificationTabEditorAreaRenderer. Do I need to copy the jar and put it in my custom extension?
No it isnt, as the complete tab is rendered by the classificationTabEditorAreaRenderer
.
The renderer ignores any additional configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
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.