cancel
Showing results for 
Search instead for 
Did you mean: 

Using OData 'search' parameter with an Input field search

0 Kudos

I have implemented an OData service on the Gateway to respond to the ?search URL parameter. However, I cannot see how, in the UI5 library, to trigger the search so that it will call the OData service with the search parameter. All the examples from the SDK and elsewhere show the use of filters.

I have tried using the solution from the following SO question: https://stackoverflow.com/questions/49429130/how-do-i-set-the-search-url-parameter-in-sapui5-odata-r...

I can see that the service is called and returns the information from a $batch call, however I then get the following error:

datajs.js?eval:17 Uncaught Error: Error: adding element with duplicate id '__item0-__input0-0'
    at onDuplicate (Element-dbg.js:169)
    at f.register (ManagedObjectRegistry-dbg.js:44)
    at ManagedObject-dbg.js:528
    at f.constructor (ManagedObject-dbg.js:558)
    at f.constructor (Element-dbg.js:151)
    at f [as constructor] (Metadata-dbg.js:463)
    at new f (Metadata-dbg.js:463)
    at f.o.clone (ManagedObject-dbg.js:5011)
    at f.d.clone (Element-dbg.js:1215)
    at b.factory (ManagedObject-dbg.js:3814)

This is my code in my event handler:

            var oSource = oEvent.getSource();
            var sTerm = oEvent.getParameter("suggestValue");
            var oBindingInfo = oSource.getBindingInfo("suggestionItems")
            oBindingInfo.parameters = {custom: { search: sTerm } } 
            oSource.bindSuggestionRows(oBindingInfo)
            oSource.setFilterSuggests(false);
bessem_m
Explorer
0 Kudos
It works, thanks!

Accepted Solutions (0)

Answers (0)