cancel
Showing results for 
Search instead for 
Did you mean: 

DefaultEditorArea Renderer

0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member625836
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

0 Kudos

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 :)