on ‎2018 Sep 21 2:14 PM
Hi Experts! I would like to extend the AdvancedSearch widget in the backoffice. I have extended AdvancedSearchEngine widget previously and it worked, but I'm trying to do it in the same way with AdvancedSearch and it doesn't work.
Here is the xml from myextension-widgets.xml that have by now:
<widget-extension widgetId="collapsibleContainer">
<remove widgetId="advancedSearch"/>
<widget id="advancedSearch" widgetDefinitionId="myextensionpath.myextensionadvancedsearch"
slotId="center" template="false">
.
. Specific widgets of the extension
.
<widget/>
<widget-extension/>
The widget "myextensionpath.myextensionadvancedsearch" has as parent the "com.hybris.cockpitng.advancedsearch" widget.
Thanks!
Request clarification before answering.
Hi , You are right, I really should use "widget-extension", but anyway my controller override method is not called. I checked documentation and I see here https://help.hybris.com/6.7.0/hcd/8bda5dec866910148593fca2c20f6a0e.html in section "Extend the Widget Controller" that I really just need to define class and definition.xml - I tried this approach, but also without success, my method never gets called, do you have any idea?
/custom/projectbackoffice/backoffice/resources/widgets/advancedSearch/definition.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget-definition extends="com.hybris.cockpitng.advancedsearch"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/widget-definition.xsd">
<controller class="project.hybris.backoffice.widgets.advancedsearch.ProjectAdvancedSearchController"/>
</widget-definition>
And then /custom/projectbackoffice/backoffice/src/project/hybris/backoffice/widgets/advancedsearch/ProjectAdvancedSearchController.java with override initOrLoadAdvancedSearchModel method, which is never called.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You are defining a new widget instance rather then changing the existing one. To change existing one, you need to use widget-extension tag instead of widget. Your current widgets.xml is not somplient with schema.
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! Any solution for this? Have same problem, my custom override method in my controller that I have defined in definition.xml is not called.
I have defined projectbackoffice/backoffice/resources/widgets/advancedSearch/definition.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget-definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/widget-definition.xsd"
id="project.hybris.backoffice.widgets.advancedsearch" extends="com.hybris.cockpitng.advancedsearch">
<name>Advanced Search</name>
<defaultTitle>Advanced Search</defaultTitle>
<controller class="project.hybris.backoffice.widgets.advancedsearch.ProjectAdvancedSearchController"/>
</widget-definition>
And later in projectbackoffice/resources/projectbackoffice-backoffice-widgets.xml
<widget id="collapsibleContainer" widgetDefinitionId="com.hybris.cockpitng.collapsiblecontainer" slotId="perspectives" template="false">
<remove widgetId="advancedSearch" />
<widget id="projectAdvancedSearch" widgetDefinitionId="project.hybris.backoffice.widgets.advancedsearch"
slotId="center" template="false">
<widget id="advancedSearchEngine"
widgetDefinitionId="com.hybris.cockpitng.widgets.common.advancedsearchengine"
slotId="cockpitWidgetChildrenInvisible" template="false">
..
<virtual-sockets/>
</widget>
<widget id="hmc2list" widgetDefinitionId="com.hybris.cockpitng.collectionBrowser"
slotId="nestedWidget" template="false">
..
</widget>
..
<virtual-sockets/>
</widget>
</widget>
Do I need to put "projectAdvancedSearch" somewhere else, so that overriding would work? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 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.