Skip to Content
0

Issue with sap.m.ComboBox - Not displaying data

Mar 24, 2017 at 01:11 PM

68

avatar image

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

before.png (13.2 kB)
after.png (6.7 kB)
10 |10000 characters needed characters left characters exceeded

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

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Mar 24, 2017 at 01:48 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Mar 24, 2017 at 01:37 PM
0

your code....

Share
10 |10000 characters needed characters left characters exceeded