cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice listview issue while customizing AdvancedSearchController

former_member634058
Active Participant
0 Likes
994

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member625836
Active Contributor
0 Likes

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

former_member634058
Active Participant
0 Likes

Hi , I have fixed it. But still the backoffice display remains the same. This overlap gets solved if I reload the browser tab. Do I need to set any class or reload some component after the search is getting returned?

former_member625836
Active Contributor
0 Likes

Now it looks like a CSS problem. Please try styling there or setting widgetStyleClass/widgetStyleAttribute on your advanced search. _width and/or _height settings may also help.

Cheers, Jacek

former_member634058
Active Participant
0 Likes

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

former_member634058
Active Participant
0 Likes

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