$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content

SAP Fiori ui5 Leave Request Application throwing duplicate id for attachments

Hey Guys,

We have done the configuration for enabling the attachments for required leave types, and it is working!

Ever since, we have faced an issue, the thing is that in the "S1 view/controller" which is responsible for two views (i.e., home page and change mode) there is an UploadCollection item in its XML view which is only visible in the change mode view obviously when the leave type has an attachment. So the problem arises when you follow this scenario:

1. the user clicks the History button in the homepage

2. the user selects the leave type which has an attachment and clicks change

3. the user goes to the change mode page (here the user can see the attachment which has been uploaded for the selected leave type)

4. the user presses the back button and goes to the history page

5. the user selects another leave which has attachment and clicks change for that

6. upon going to the change view for the second time then we get the EXCEPTION!, and obviously we can't proceed to the change view page..

You may ask where or what the exception is, I will give you more details in the following.

The exception is where the model is being set for uploadCollection item with the "fileupload" id to be specific this is the line:

this.byId("fileupload").setModel(f, "files");

And the exception is: adding element with duplicate id '__attribute4-__xmlview6--fileupload-0'

After a lot of debugging I found that each item (uploadCollectionItem) which is being added to the uploadCollection have an ID A.K.A (as known as) documentId which is unique. The most astonishing thing is that in the S6B view/controller we have the same uploadCollection item in its view and also the same logic is implemented in its controller, but that one works fine!! I have done a lot of tricks and debugging but I haven't came up with any solution or found an OSS Note.Kind Regards, Ehsan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 26, 2016 at 05:32 PM

    I have the same issue with our custom fiori app. Did you ever find out the solution?

    Best,

    --Jamie

    Add comment
    10|10000 characters needed characters exceeded