on 08-29-2014 5:38 PM
Fellow Members - Custom UI5 application configured into the Fiori Launch Pad and able to launch successfully first time. However, when user click on "Home" button on the Custom Application to navigate back to launch pad and re-launch same application, application end up with error - "Adding element with duplicate id". Seem like some reason Controls don't get destroyed when application destroyed.
Was spent time looking into the issue and was end up with no luck.The error is simple and make sense but don't know the fix 😞
I am looking for thoughts & direction to fix the issue.
Happy Friday..
Tags edited by: Michael Appleby
Even I had come across same problem. I have noticed the SAPUI5 framework is not destroying the content and instances of the component container when we destroy using
UIComponent.prototype.destroy.apply(this, arguments)" |
I have variant Management control on my page and destroying on its controller using this.destroy() did not destroy the variant Management control instance.
So best option what I have tried is to remove id of the view. So that framework generates id for the view each time you move away from the page and come back. Hence it resolved duplicate Id issue and I was able to navigate as many times back and fro from launchpad to app.
Note*:
If the id for the view is specified in component.js or manifest.js you need to remove it.
"targets": {
"worklist": {
"viewName": "Worklist",
"viewId": "worklist", // Remove this line in the configuration
"viewLevel": 1
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I've been "fighting" with that same error. I'm using a Dialog to make the user "Continue" or "Cancel", and the Dialog, buttons and an input field have its own id.
So when the user take a decision the first time all was working... but not the second time.
The solution I have applied is to "destroy" the dialog once the user has clicked a button, instead of "close"... that way it seems that the Dialog is always been created each time is needed, and there's no conflict with the identifiers.
var oButton2 = new sap.m.Button("Cancel", {
text: "Cancel",
press: function(oEvent) {
//sap.ui.getCore().byId("returnDialog").close(); ---> Not working
sap.ui.getCore().byId("returnDialog").destroy(); ---> Solution
}
});
I hope it can help some of you.
Regards,
Juande
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just FYI,
I also had the same error message.
The reason was in Component name. I input company.app.Component while it should be just like company.app.
So there is no .Component in Target mapping.
Probably it can be useful for someone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same proplem with VariantManagmant and local launchpad. I can launch my application from the launchpad only one time. When we backed to launchpad and try to launch it again I've got duplicate id error. This id belonged to VariantManagment control. So I try to wrap this control using HorizontalLayout. I removed id from VariantManagment and added id to HoryzontalLayout. And it helped. Try to do something in this way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure on about the root cause of the issue. But changing the application type from LPD_CUST to SAPUI5 in launchpad admin page should fix this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mike,
No, the change I had mentioned is to be done in the Fiori Admin page where you had created the custom catalog & groups. Here where you have the option to provide the custom UI5 application as a direct link(SAPUI5) or as LPDCUST entry.
But that is just a workaround, which fixed the same issue I had before. Its better to upgrade the UI5 libraries and also check if there are any issue in the UI5 application.
Hi Mike,
I dont have access to the system right now to send a screenshot. But you should be able to find this option in Fiori Admin -> Target Mapping -> Target. In target, if you have the latest UI5 library version, then you should be getting the option to select either LPDCUST or SAPUI5 (radio button). But if you are using older library version then your only option is to use the LPDCUST.
Please make sure that you have applied all notes in below link.
Hi Aakash,
Thanks a lot for you efforts.
I have to use the LPD_CUST variant though, due to the way the roles are being assigned here.
It also fits in with all the other standard Fiori apps that are being used.
Like you say, that would only be a workaround anyway.
I will try to restructure the app to eliminate the problem.
Mike
Hi Christoph,
changing the code to use createId etc. did not work for me, I still got the same "duplicate ID" errors, when calling the App from the Fiori Launchpad.
What method are you using to navigate between the views?
All my problems disappeared, when I switched from the old "event-bus/navigation" model to the newer "routing" model.
I have no further duplicate ID issues, even if I use fixed IDs for some elements.
Hope this helps, as the issue is (I know) very frustrating.
Regards,
Mike
Hello Cristoph,
Thanks, actually I changed all my app to Router approach, and the error disappear, may be could I ask you something else, I don't want to handle bookmarking in routing so I would like to hide the hash that appears in url without changing my patterns, do you know if this can be possible?.
Thank you very much in advanced.
Best regards.
Jhon Jairo.
Hi Anil,
did you manage to resolve this issue? I am having exactly the same problem.
The suggestion to not use any IDs whatsoever in the views seems like a very unsatisfactory solution to me. Sometimes I need an ID for a control!
I have also tried using createID() instead of hard-coding - same result.
I don't really undertsand why the controls are not destroyed when the application/component is closed. They just seem to hang around, or at least the name hangs around. I have had occasions where the control itself (e.g. a page) does not exist, but I still get a duplicate ID error, when I try to create it again.
Any further information you have relating to this issue would be very welcome.
Thanks & Regards,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would need some more details from your CHROME or FF debug console. In your custom SAPUI5 app do not create the control with a specific ID and instead just leave it blank. Pls try that and let me know.
thanks
A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ashish!! Below is the error details captured from Developer Tools of Chrome browser. I willl try out your suggestion to have a Control with blank ID and keep you posted on the result.
******************************************************************************************************************
***********************************************************************************************************************
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
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.