on 2020 Dec 08 9:10 AM
Request clarification before answering.
Answer :
You can write a filter/ adapter as below.
Code is not to the point for classes/ models, please change based on Hybris version.
Hope it solves your problem.
class YourClass extends AbstractInitAdvancedSearchAdapter {
public void addSearchDataConditions(final AdvancedSearchData searchData)
{
final FieldType fieldType = new FieldType();
fieldType.setDisabled(Boolean.FALSE);
fieldType.setSelected(Boolean.TRUE);
fieldType.setName("catalog");
// multi conditions
searchData.addCondition(fieldType, ValueComparisonOperator.EQUAL, CatalogVersion.Staged);
searchData.addCondition(fieldType, ValueComparisonOperator.UNEQUAL, OrderStatus.Online);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
I am not sure if this is possible. Probably it is, but I will be in glad if someone else can answer the question too. I had the same requirement in In my previous project. Some of the search attributes in the advanced-search to be preselected. What you will find as solution below is the one that we provided to our customer. It is not exactly what you are looking for, but it's very close and easy achievable as configuration. Please find the solution below.
<context merge-by="type" type="Media" component="advanced-search" >
<advanced-search:advanced-search>
<advanced-search:field-list>
<advanced-search:field name="catalogVersion" editor="" selected="true" >
<advanced-search:editor-parameter>
<advanced-search:name>referenceSearchCondition_version_equals</advanced-search:name>
<advanced-search:value>Staged</advanced-search:value>
</advanced-search:editor-parameter>
</advanced-search:field>
<advanced-search:field name="folder" selected="true" >
<advanced-search:editor-parameter >
<advanced-search:name >referenceSearchCondition_path_equals</advanced-search:name>
<advanced-search:value>images</advanced-search:value>
</advanced-search:editor-parameter>
</advanced-search:field>
</advanced-search:field-list>
</advanced-search:advanced-search>
</context> Actually this will limit the results in the in the searched fields, but I don't know if it's possible to be preselected.
Hope this helps.
P.s Please don't forget to vote for the answer if you find it as reasonable.
Best Regards,
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 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.