on 02-21-2014 11:03 AM
Hello,
we use the SAPUI5 element 'shell'. After selecting a few things on the first tabs we create a new tab "results" and present the aggregation of the previous selection the user has made.
Now the user can go back to the first tab in order to start a new selection. Therefore we remove the "result" tab using this method:
oShell.removeWorksetItem("RESULT");
If the user makes a new selection and we want to add the result tab again we get an error that says:
Uncaught Error: Error: adding element with duplicate id 'RESULT'
We also tried to remove the WorksetItem using this method:
oShell.destroyWorksetItems("RESULT"); |
but it didnt't work, either.
My question would be. Is it possible to 'really' remove the WorksetItem or is it possible to hide it until another selection has been made?
Thanks in advance for your help.
Regards,
Stefan
Hi Stefan,
Try destroying worksetitem after removing from shell. After that, this worksetitem ID is not used and you could instantiate a new one with the same id.
This is the example:
var workset = sap.ui.getCore().byId("your_worksetitem_id");
sap.ui.getCore().byId("your_shell_id").removeWorksetItem(workset);
workset.destroy();
sap.ui.getCore().byId("your_shell_id").insertWorksetItem(new sap.ui.ux3.NavigationItem("your_worksetitem_id",{key:"your_worksetitem_id",text:"Workset Item"}),0);
Kind regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Angel,
thank you for your fast reply. In the meantime a friend of mine had the same idea like you. Here are the lines that do the magic. The only problem was to get only one worksetItem destroyed and not all of them:
var ws = new sap.ui.ux3.NavigationItem("RESULT",{key:"result",text:"Results"}); | |||||
global.variables.worksetResult = ws; | |||||
global.variables.oShell.addWorksetItem(ws); and after use (if the user wants to make a new selection):
|
Now the worksetItem is really removed and destroyed and a new worksetItem with the same ID can be instantiated.
Thanks again and kind regards,
Stefan
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.