cancel
Showing results for 
Search instead for 
Did you mean: 

Prefilling reference search via custom Multireferenceeditor

Former Member
0 Kudos

Hey folks,

I have Multireferenceeditor where I open a reference search which I need to preconfigure somewhat. It has an attribute "catalogVersion" and I want to search only for the predefined Catalogversion I'm giving it to the context. actually I'm using the following code to open the referencesearch:

 @Override
 public void openReferenceAdvancedSearch(final Collection currentlySelected)
 {
     final TypeAwareSelectionContext typeAwareSelectionContext = new TypeAwareSelectionContext(null,
             Lists.newArrayList(currentlySelected));
     typeAwareSelectionContext.setTypeCode("CavokMedia");
     typeAwareSelectionContext.setMultiSelect(true);
     typeAwareSelectionContext.addParameter(TypeAwareSelectionContext.SEARCH_CTX_PARAM, getReferenceSearchContextMap());
     getEditorContext().getParameters().forEach((key, value) -> typeAwareSelectionContext.addParameter(key, value));
     sendOutput("premReferenceSearchCtx", typeAwareSelectionContext);
 }

Is there any way to send some CatalogVersion parameter for the search?

Former Member
0 Kudos

Hello, Just for clarity - does your question concern the backoffice?

Best regards,

Former Member
0 Kudos

Hey Jadwiga,

exactly but I made it different. Is there a way to tell the AdvancedSearch via TypeAwareSelectionContext which advanced-search component he should choose?

Something like that where I preset the catalogVersion:

 typeAwareSelectionContext.addParameter("referenceSearchCondition_CatalogVersion", pocoProduct.getCatalogVersion());

I'm able to tell him which advanced-search he should choose right now but he's not using any field-lists inside of it.

 typeAwareSelectionContext.addParameter("advancedSearch/advancedSearchConfigCtxCode", "test");

Former Member
0 Kudos

Hi, Daniel ! Could you, please, share with us your approach to solving this problem if you have found a solution ? Because i have the same task, where I must filter products in the selection listbox, but can't get reference to needed catalog version from .. parent object for example using xml config like this

  <wz:editor-parameter>
                                 <wz:name>referenceSearchCondition_catalogVersion</wz:name>
                                 <wz:value>{parentObject.catalogVersion}</wz:value>
  </wz:editor-parameter>

Thank you!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Or is there any possibility to manipulate the ReferenceListBox?

I made my multireferenceeditor displaying different itemtype then the ReferenceEditor has. From CavokMedias (which is just a relation between the Products and the CavokMedias) to CavokMedia (which are the medias itself). So is there any way to give the items inside the list their own listener so that if I click on an item some custom code will be triggered?

Is there any method? Cause I cant find anything for customizing the ReferenceListBox except this:

 @Override
 public void updateReferencesListBoxModel(final String textQuery)
 {
     final SearchQueryData searchQueryData = buildSearchQuery(textQuery, typeCode, pageSize);
     pageable = getReferenceEditorSearchFacade().search(searchQueryData);
 }
Former Member
0 Kudos

Hello, Daniel. Have you managed to do so? If yes - please let me know. I have the same task.

Former Member
0 Kudos

Hey , you have to configure a list-view inside the config-xml with the following editorparameters:

                         <editorArea:editor-parameter>
                             <editorArea:name>collectionBrowser/colConfigCtxCode</editorArea:name>
                             <editorArea:value>cavokMediasListView</editorArea:value>
                         </editorArea:editor-parameter>