on 03-27-2017 7:48 AM
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);
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.