To post no data in slave page and select first value in the list



updateFinished="listUpdFnsh"

selectFirstItem: function () {
var oList = this.getView().byId("listPartner");
var aItems = oList.getItems();
if (aItems.length) {
oList.setSelectedItem(aItems[0], true);
//Load the detail view in desktop
this.loadDetailView();
oList.fireSelect({
"listItem": aItems[0]
});
}
else{
var bindingObject="No items are currently available";
sap.ui.getCore().setModel(bindingObject,"masterSelectedObj1");
this.getRouter().navTo("notFound");
}




var a = thatMaster.getView().byId("listPartner").getItems().length;

if(a >0){
this.selectFirstItem();
// this.getRouter().navTo("detail", {
// //from: "master",
// SoldToPartyNo: thatMaster.getView().byId("listPartner").getItems()[0].getTitle()});

}else{
this.getRouter().myNavToWithoutHash({
currentView: this.getView(),
targetViewName: "com.ril.crm.ecom.bulkOrder.view.notFound",
targetViewType: "XML"
});
}

Post a Comment

Previous Post Next Post