cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with sap.m.ComboBox - Not displaying data

thomas_arnesen
Explorer
0 Kudos

Hi all

I've an issue with the ComboBox. After navigating from the app to the home page and back to the app, the combobox displays the right number of lines (items from OData) but no text. And when selecting one of the empty lines there's no key.

When first loading the app (by clicking its tile on the Fiori launchpage), the OData service correctly populates the ComboBox (using bindItems() in the view's controller):

If navigating back to the Fiori launchpage then click the app tile to go back into the app, the OData service is triggered again but now no data is in the ComboBox (but the number of lines are as expected; in this example it results in 5 empty lines but no text/key):

If I do a browser refresh (F5) at this stage then the data is displayed as if the app is loaded for the first time.

Anyone seen this behaviour before?

The code that populates the ComboBox is as follows, this method is called in onInit() of the view controller:

	    setReports: function(ipType, ipNoMsg){
	        var oDropDown = this.byId("selectEmployee");
	        this._resetTiles();
	        oDropDown.setBusyIndicatorDelay(1);
	        oDropDown.setSelectedKey(null);
	        oDropDown.destroyItems();
			oDropDown.bindItems({
			    path: ipType,
			    template: this._oTemplate,
			    events: {
			        dataRequested: function(oEvent){
						oDropDown.setBusy(true);
			        },
			        dataReceived: function(oEvent){
						oDropDown.setBusy(false);
			        }
			    }
			});
	    },

When exiting the app, I've tried (in onExit() of the view's controller) to destroyItems(), unbindItems() and removeAllItems() on the ComboBox but it makes no difference.

Any help and insight appreciated.
Thomas

thomas_arnesen
Explorer
0 Kudos

I've added the code now, sorry forgot to earlier!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member203031
Contributor
0 Kudos

Hi Thomas,

Kindly check the id of the combobox.

Then look it.

As you are using the bindItems() in the view's controller then the values are binding to the combobox.

I am expecting you may wrote this binditems() in the oninit() function.

But when navigate to the the back page the model will not be updated.

Thanks,

Deepak Raj.

junwu
Active Contributor
0 Kudos

your code....