on ‎2019 Mar 26 5:35 PM
I have customized the AdvancedSearchController by modifying the widgets.xml file and creating new definition.xml and CustomerAdvancedSearchController.java files.
widgets.xml:
<widget-extension widgetId="collapsibleContainer">
<remove widgetId="advancedSearch" />
<widget id="advancedSearch" widgetDefinitionId="com.custom.widgets.advancedsearch"
slotId="center" template="false">
<widget id="hmc2list" widgetDefinitionId="com.hybris.cockpitng.collectionBrowser" slotId="nestedWidget" template="false">
<setting key="pageSize" type="Integer">10</setting>
<setting key="socketDataType_$T" type="String">java.lang.Object</setting>
<setting key="dragAndDropConfigCtx" type="String">dragItemsDnDComponent</setting>
<setting key="widgetStyleClass" type="String"></setting>
<setting key="widgetStyleAttribute" type="String"></setting>
<setting key="listSubtitle" type="String">emptylist</setting>
<setting key="multiSelect" type="Boolean">true</setting>
<virtual-sockets/>
</widget>
<remove widgetId="advancedSearchEngine" />
<widget id="advancedSearchEngine" widgetDefinitionId="com.custom.widgets.advancedsearchengine"
slotId="cockpitWidgetChildrenInvisible" template="false">
<setting key="widgetStyleAttribute" type="String"></setting>
<setting key="widgetStyleClass" type="String"></setting>
<setting key="defaultPageSize" type="Integer">50</setting>
<virtual-sockets />
</widget>
<setting key="widgetStyleClass" type="String"></setting>
<setting key="widgetStyleAttribute" type="String"></setting>
<setting key="enableNestedWidgetView" type="Boolean">true</setting>
<setting key="forceSearchForCode" type="String">WorkflowAction,Principal,AbstractConstraint</setting>
<setting key="disableAutoSearch" type="Boolean">true</setting>
</widget>
</widget-extension>
definition.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget-definition id="com.custom.widgets.advancedsearch" 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">
<name>Extended Advanced search</name>
<defaultTitle>Extended Advanced search</defaultTitle>
<controller class="com.custom.widgets.CustomAdvancedSearchController" />
</widget-definition>
After that, there occurs one small issue with the listview UI:

As can be seen, the listview cannot be viewed as "0 ITEMS SELECTED" section oevrlaps it. I am not able to identify why this is happening.
Request clarification before answering.
Hi ,
If you are pasting your widgets.xml in exact form, then it is incorrect. You cannot add remove element into widget element. Please correct your file and make it compatible 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.
Any idea where this is expected? I have tried _width and/or _height settings for "advancedSearch", "advancedSearchEngine" and "hmc2list", but without any solution. When I see the code, once the search is executed, there is a call to recalculateNestedWidgetSize where Clients.resize is happening. Any chance it is breaking somewhere in this code?
Thanks for your reply.
Sumit
Currently when I checked the css, the section is having width and height 100%. 
But when seeing the backoffice screen, it seems the listview section is hidden somewhere. 
Not able to identify from where this section marked in red is coming. This section goes away on reloading the browser.
Any help is appreciated.
Thanks,
Sumit
| User | Count |
|---|---|
| 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.