on ‎2019 Jun 20 12:58 AM
I'm trying to override the FullTextSearchController in PCM Backoffice to not populate the product list at the time user logs in. I want user to explicitly search for the product.
I'm able to do that by overriding the FullTextSearchController and defining my own controller instead.
The problem I'm running with is that when I click the catalog selection, that event doesn't update the content in the content browser. It is working fine with OOTB FullTextSearchController.
I've copied the socket connections.
Attached is my definition.xml file. definition.xml
Attached is my widgets.xml file. widgets.xml
Request clarification before answering.
Hi
By your customization you protect against executing search when text is not blank. If user leaves empty input and click on catalog selection, add some filter, your search will also skip.
In order to handling search execution if user clicks on catalog, catalog version (search input is empty) you have to build more complex condition based on AdvancedSearchData structure.
@Override
protected boolean doSimpleSearch()
{
boolean searchExecuted = false;
final AdvancedSearchInitContext context = getValue(MODEL_INIT_CONTEXT,AdvancedSearchInitContext.class);
final List<SearchConditionData> catalogVersionConditions = context.getAdvancedSearchData().getConditions("catalogVersion");
if (StringUtils.isNotBlank(getSearchText()) || CollectionUtils.isNotEmpty(catalogVersionConditions))
{
searchExecuted = super.doSimpleSearch();
}
return searchExecuted;
}
Of course above code is not final solution. You have to take into consideration other search parts like filters. All that data are stored in context.getAdvancedSearchData() so you should carefully verify them.
I hope that I roughly explained how it works. Cheers!
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 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.