cancel
Showing results for 
Search instead for 
Did you mean: 

How to save editor area value automatically in backoffice ?

Former Member
0 Kudos

Hi,

Requirement is price should get automatically save, when change for a quote entry without clicking SAVE button in backoffice.

Please let me your inputs to achieve this in back office .

Thanks,

Pankaj

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member625836
Active Contributor

Hi,

If you are working on at least 6.1 version of hybris, then there is an interface com.hybris.cockpitng.widgets.baseeditorarea.EditorAreaLogicHandler with default implementation com.hybris.cockpitng.widgets.baseeditorarea.DefaultEditorAreaLogicHandler defined as editorAreaLogicHandler spring bean. I would go with writing my own (extending default one), defining it as spring bean and pointing to it in configuration for quote entry (`handler` attribute on editorArea element). There is a method #beforeEditorAreaRender which allows to register any listener you wish (I'd go with widgetModel.addObserver(DefaultEditorAreaController.MODEL_VALUE_CHANGED, ...))

Cheers, Jacek

Former Member
0 Kudos

Hi Jacek,

Thanks for your suggestion.

I have implemented #beforeEditorAreaRender in my own logic handler extending DefaultEditorAreaLogic Handler and pointing to quote entry ( logic-handler attrribute on editorArea element in *-backoffice-cofig.xml)

<context merge-by="type" parent="AbstractOrderEntry" type="QuoteEntry" component="koopmanSalesRepBackofficeEditorArea"> <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea" logic-handler="quotePriceLogicHandler"> </editorArea:editorArea> </context>

My Logichandler#BeforeEditorAreaRender goes like this- QuotePriceLogicHandler#beforeEditorAreaRender(final WidgetInstanceManager widgetInstanceManager, final Object currentObject) final QuotePriceObserver priceObserver = new QuotePriceObserver();

widgetInstanceManager.getModel().addObserver(DefaultEditorAreaController.MODEL_VALUE_CHANGED, priceObserver.init());

But this is not working for my problem statement.

Please suggest me where i am going wrong here. Might be an issue with ValueObserver, but i am not able find out how valueobserver works or else any other suggestion to achieve this, i am using Hybris 6.3 .