on 2018 May 15 9:57 AM
Hello,
how do you replace any of the DefaultEditorArea Renderers e.g. com.hybris.cockpitng.widgets.editorarea.renderer.impl.DefaultEditorAreaSectionRenderer with your own implementation?
I tried to:
create "CustomEditorAreaSectionRenderer" extending "DefaultEditorAreaSectionRenderer"
create bean for CustomEditorAreaSectionRenderer in *-backoffice-spring.xml
This is where i failed first trying to set the parent to "defaultEditorAreaSectionRenderer" since this bean somehow does not exist.
All the other workarounds I tried did not seem to be successful, monitoring through a breakpoint on the setter in DefaultEditorAreaTabRenderer where the CustomEditorAreaSectionRenderer shall be injected into.
Many thanks in advance for your help.
Hi ,
They are all defined as Spring beans, so you can always inject your own. Pleas bear in mind that this change is application-wide, so your custom logic should be somehow configurable (i.e. by widget settings). To change a renderer used by default implementations, you should use extenders (a property extender in this case). To do so please add xmlns:cng="http://www.hybris.com/cockpitng/spring"
namespace to your spring bean definitions file ( *-backoffice-spring.xml
) and you can use extenders easily:
<cng:property-extender bean="defaultEditorAreaTabRenderer" property="editorAreaSectionRenderer">
<ref bean="myCustomSectionRenderer"/>
</cng:property-extender>
Voilà!
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo Jacek,
first of all let me thank you for pointing me in the right direction. I was able to solve my issue with your help after some minor changes to the code you provided:
<cng:property-extender bean="editorAreaTabRenderer" property="editorAreaSectionRenderer">
<ref bean="hffEditorAreaSectionRenderer"/>
</cng:property-extender>
The bean "defaultEditorAreaTabRenderer" does not exist, I simply had to replace it through "editorAreaTabRenderer". Futhermore in addition to the xmlns:cng... the url http://www.hybris.com/cockpitng/spring must also be added to the xsi:schemaLocation.
Many thanks again for the rapid solving of that issue :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
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.