Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap.m.upload.UploadSet incompleteItem setSelectItem does not work #4026

Open
cbsmerveguel opened this issue Apr 18, 2024 · 3 comments
Open

Comments

@cbsmerveguel
Copy link

cbsmerveguel commented Apr 18, 2024

Hi gurus,

We are using UploadSet with "incompleteItem" aggregation due to the fact that we are processing the uploaded documents first and set them as "Complete" at a later point. As the processing gets finished, we set the incompleteItem's uploadState as "sap.m.UploadState.Complete". Right after this completion, we required to select the the first item that is completed in the "incompleteItem" list. However, as we tried to apply this functionality, we got to see that the "setSelectedItem" method throws the below error:

image

Code Snap:

          if (!bIsSelected && oIncompleteItem.getUploadState() === this._aMainConstants.COMPLETE) {
            uploadSet.setSelectedItemById(oIncompleteItem.getId(), true);
            uploadSet.fireSelectionChanged();
            bIsSelected = true;
          }

sap.m.upload.UploadSet 1.120.8
As we debugged the issue and as can be seen in the method "_getUploadSetItemById"; this.getItems() collects the items only from "items" aggregation and it is empty. Ideally, we would expect our item to be selectable either as a incompleteItem or an actual item regardless of its uploadState. Therefore, we think this.getItems() should also support the array of incompleteItems list. We also would expect that, if an incompleteItem gets an update to its uploadState as "sap.m.UploadState.Complete", then it should be added into the "items" aggregation. We tried to manually remove the item from the "incompleteItem" aggregation and add/insert it into the "items" aggregation but it didn't work, because the object id was already used and removed.

image

We are asking your support and expertise on this matter,

Thanks in advance,

Best,
Merve

@dimovpetar dimovpetar self-assigned this Apr 18, 2024
@dimovpetar
Copy link
Contributor

Hello @cbsmerveguel ,

I have prepared a small test page that shows the first issue with setSelectedItem https://stackblitz.com/edit/vitejs-vite-tvzjnv?file=index.js. Please check if this is what you have meant.
For the second issue about upload state, please open another incident.

Best regards,
Petar

@cbsmerveguel
Copy link
Author

cbsmerveguel commented Apr 19, 2024

@dimovpetar thank you for the test page example, that is accurately displays our issue.
I am raising a second incident for the latter issue.

FYI: sap.m.upload.UploadSet aggregations do not get an update as uploadState property shifts

Thanks again!
Best,
Merve

@dimovpetar
Copy link
Contributor

Hello @cbsmerveguel ,

I've created an internal incident DINC0128813. The status of the issue will be updated here in GitHub.

Regards,
Petar

@dimovpetar dimovpetar removed their assignment Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants