Skip to Content
avatar image
Former Member

Fiori extend with suggest for external url

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 >= 8) { 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);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers