on ‎2019 Feb 26 3:22 PM
Hello Experts,
I've got a problem and I'm scathing my head for a while. I have two views in an SAPUI5 simple template app I created. Simple with nothing but couple of buttons on them and I'm navigating from View1 to View2 just fine using routing and I'm testing in run as FLP Sandbox. While going back to View1 using routing navigation I get an error "Error: adding element with duplicate id" for some control "application-Test-url-component---List". Just to make it clear I do put in the destroy method in the component.js like it is mentioned here https://archive.sap.com/discussions/thread/3730983
and I do tried destroying view onExit.
Any help would be appreciated.
Request clarification before answering.
Thanks for the reply Mahesh, My View Name is List and I'm thinking it is just trying to instantiate it again. Below is my List.controller.js
sap.ui.define(["sap/ui/core/mvc/Controller"], function (Controller) {
"use strict";
return Controller.extend("olin.shipment.OLIN_SHIPMENT_OUTPUT.controller.List", {
onInit: function () {},
onExit: function() {
var oView = this.getView();
//this.getView().destroy();
},
/**
*@memberOf olin.shipment.OLIN_SHIPMENT_OUTPUT.controller.List
*/
onNavigate: function (oEvent) {
//This code was generated by the layout editor.
var oRouter = this.getOwnerComponent().getRouter();
oRouter.navTo("Output", {
objectId: "test"
});
// this.getView().destroy();
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.