cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori extend with suggest for external url

Former Member
0 Kudos

Not able to do suggest item for standard Fiori Apps.

Input suggestion item does not work while extending a standard FIORI Apps for a custom input field. It is taking default OData model of the FIORI. Same code works if we run in separate UI5 Application.

I have created below input field in fragment:-

<Input id="idAddress" type="Text" showSuggestion="true" suggest="onAddressTyped" suggestionItems="{myModel>/results}" suggestionItemSelected="onAddressSelected"> <suggestionItems> <core:Item text="{formatted_address}" /> </suggestionItems> </Input>

Controller:- Code is triggering in success method but suggestion is not working

onAddressTyped : function(oEvent) { // var sTerm = oEvent.getParameter("suggestValue"); if (sTerm.length >= 😎 { var aFilters = []; if (sTerm) {

url = 'XXXX'

oModel1 = new sap.ui.model.json.JSONModel();

$ .ajax({ url : url,

jsonpCallback : 'getJSON', contentType : "application/json", dataType : 'json',

success : function(data, textStatus, jqXHR) {

sap.ui.getCore().setModel(oModel1, "myModel");

aFilters.push(new sap.ui.model.Filter("formatted_address", sap.ui.model.FilterOperator.Contains, "")); oEvent.getSource().getBinding("suggestionItems").filter(aFilters);

Accepted Solutions (0)

Answers (0)