SAPUI5. My Inbox. Attachments asynchronous update

Viewed 745

I use SAP standard library: Inbox.

in library class S3.controller by tap on attachments icon is onTabSelect event executed, witch makes

this.fnDelegateAttachmentsCreation();
this.fnFetchDataOnTabSelect("Attachments");
this.fnHandleAttachmentsCountText("Attachments");
this.fnHandleNoTextCreation("Attachments");
break;

fnFetchDataOnTabSelect makes an asynchronous call. During this call is fnHandleAttachmentsCountText already executed, so the update of attachments count occurs before the request for attachments is ready. As far the request for attachments is ready, there is no update for title executed.

On screenshot is AttachmentCountText „Attachnents (1/1)“, that comes from previously selected item. It should be „Attachements (2/2)".

enter image description here

Also if response comes too quick, then view changes to loading view after it received the answer from request. If list of attachments was updated from request callback, then it should not be updated second time.

Here it seems, that there is something on loading, but request is already finished.

enter image description here

How could be Inbox extended, to update the attachment header and content after request is ready?

used SAPUI5-Version: 1.71.4

2 Answers
  • You are using the standard bsp-application ca_fiori_inbox?
  • You didn't create an extension project of the application ca_fiori_inbox with custom coding?

If that's the case, it's a bug in an standard application delivered by the SAP. SAP releases so called notes to fix bugs in their standard applications.

You can import notes in your system via the transaction SNOTE. May ask a SAP Basis Administrator from your company for help.

The following notes exactly describe your problem


If you already extended the SAP standard application(MyInbox) without using ExtensionPoints codechanges in the standard application will not affect your custom extension.

When overriding a controller method, any functionality that was previously provided by it is no longer available. Likewise, any future changes made to the original controller method implementation will not be reflected in the custom controller.

In this case you could still implement the note and check the changes in the standard controller vs. your custom controller on your system and change the respective lines in your custom coding.

Don't fix SAP coding. Report it and get a fix.


The Note 2873960 corrects coding in an abap class, not in the bsp-application(ca_fiori_inbox). So definitly import the note and check if it's fixing your problem.

I actually do not know, how the app works, but I want to give it a try.

Since it is an asynchronous function, you can always also wait for the function until it is done. So in your case, you could try to set an await keyword in front of the function.

await fnFetchDataOnTabSelect("Attachments");

This will now wait on this position until it has finished the function call before it will call the next functions. In addition to that you also need to set the upper function onTabSelect to async. So in the end it should look something like this.

onTabSelect: async function() {
    // ...
    this.fnDelegateAttachmentsCreation();
    await this.fnFetchDataOnTabSelect("Attachments"); 
    this.fnHandleAttachmentsCountText("Attachments");
    this.fnHandleNoTextCreation("Attachments");
    // ...
}

Although the Web IDE maybe shows you errors, it does work, since it is an official JavaScript API.

Related