widgetsap-commerce-cloudzulbackoffice

Hybris backoffice extend widget


enter image description here

This is the syncronization popup (com.hybris.backoffice.widgets.syncpopup.SyncPopupController) used to synchronize catalogs . I want to modify this OOTB widget in order to add multiple selection instead of one (right now , you can only select one catalog at a time).

How can I achieve this ? I don't know how to extend backoffice widgets.


Solution

  • The Listbox you're trying to modify has an attribute called multiple. By default at initialization this is false. The widget lists (because there are 2 lists, one for stage->online and one for online->stage) doesn't have this attribute set to true when the widget is created. The initialize() method from the SyncPopupController only fill these lists with items but nothing more.

    Now that you know the root of the problem, you can read this tutorial which explains you how you can extend a widget mot-a-mot. One solution could be extending the original controller and make your custom configuration in the initialize() method.

    This could look like this:

    public class ExtendedSyncPopupController extends SyncPopupController
    {
       public void initialize(Component component){
           super.initialize(component);
           super.getPullList().setMultiple(true);
           //etc.
       }
    }
    

    And after this, you can override the widget definition ( Overriding the Widget Definition chapter from the tutorial provided above ) and pass your custom controller class in <controller class="ExtendedSyncPopupController">.