Hi All,
While i navigate from detail1 page to another master2-detail2 page , i have to select first record in master2 by default while laoding master2-detail2.
but it is not working and no error in console also.
below is my code for default selection.
in master2 controller and in onInit() method i have written code as below.
this.waitForInitialListLoading(function() {
//On the empty hash select the first item
this.selectFirstItem();
});
waitForInitialListLoading: function(fnToExecute) {
jQuery.when(this.oInitialLoadFinishedDeferred).then(jQuery.proxy(fnToExecute, this));
},
selectFirstItem: function() {
var oList = this.getView().byId("list2");
var aItems = oList.getItems();
if (aItems.length) {
oList.setSelectedItem(aItems[0], true);
}
},
please help
Regards,
Vamsi