on 03-06-2019 1:19 PM
Code
onInit: function () {
this.router = sap.ui.core.UIComponent.getRouterFor(this);
this.detailModel = sap.ui.getCore().getModel("detailModel");
this.getView().setModel(this.detailModel, "detailModel");
this.router.attachRoutePatternMatched(this._handleRouteMatched, this);
},
_handleRouteMatched: function (evt) {
if (evt.getParameter("name") !== "CloneTravelRequest") {
return;
}
var that = this;
//fetching Train Names
$.ajax({
url: "/Non_sap_create_requests/odata/TravelPrpTrainDetails",
method: "GET",
dataType: "json",
success: function (data) {
that.getView().getModel("Model").setProperty("/TravelPrpTrainDetails", data.value);
var tempModel = that.getView().getModel("detailModel");
var train = tempModel.getData().TrainName;
var trainKey = formatter.pickTrainKeyFromModel(data.value, train);
that.getView().byId("trainName").setSelectedKey(trainKey);
that.setLocations();
var nameofPass = tempModel.getData().NameOfPsngr;
if (nameofPass === "" || nameofPass === null) {
that.getView().byId("nameOfP").setValue(tempModel.getData().Requestee);
}
},
error: function (err) {
console.log(err.message);
}
});
var fdate = new Date();
this.getView().byId("date").setDateValue(new Date());
this.getView().byId("date").setMinDate(fdate);
// this.onBeforeRendering();
},
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.