cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori ui5 Leave Request Application throwing duplicate id for attachments

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201781
Participant
0 Kudos

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

Best,

--Jamie