Openui5: ObjectPage: async creation of block views

Created on 30 Nov 2018  路  6Comments  路  Source: SAP/openui5

OpenUI5 version: 1.58.5

Browser/version (+device/version): Chrome 70

Hello,

Lately, I was checking my application with support assistant and found the following:

The XML view 'MyPageBlock' is loaded synchronous. Please take a look at the resolution 'Instantiating Views'.

I was trying to find something about the async block view creation in the BlockBase documentation, but didn't find anything. So, I just tried to add an "async": true to my block view definition:

return BlockBase.extend("MyBlock", { metadata: { views: { Expanded: { viewName: "MyBlockView", type: "XML", async: true } ...

It's sorta helped - I don't see this error anymore, but I found another issue - this.oParentBlock became undefined in the block's controller.

Could you give me some advice on this or is it a bug?

Thanks!

author action consulting

All 6 comments

Hello @whydrae ,
Thank you for sharing this finding. I've created an internal incident 1870497873. The status of the issue will be updated here in GitHub.
Regards,
Georgi

Hi @whydrae,
Can you provide some more code samples and explanations in order to understand the issue better?

Thanks,
Georgi

Hi @GeorgiValkanov,

Go to https://sapui5.hana.ondemand.com/#/sample/sap.uxap.sample.ObjectPageBlockBase/preview page and run Support Assistant with rule "Asynchronous XML views". In the log you'll see a lot of warnings on blocks, for example "The XML view 'BlockBlue is loaded synchronous. Please take a look at the resolution 'Instantiating Views'.".

Could this be a Support Assistant issue?

Best regards,
Ilya

Hi,

This issue is expected to be reported by Support Assistant. One should also not make the views async as this is not expected to work correctly. The ObjectPage's BlockBase currently loads views using an older, synchronous API. Converting this functionality to become based on asynchronous API is a task our team plans to execute in the near future and an internal backlog item is created.

I am closing this issue now and stay posted for details on this feature in the next releases.

Best regards,
Jordan

Hi, is there a plan when this feature will be available? Version 1.xx?

Since https://github.com/SAP/openui5/commit/773800eb93677a66b43d21e51f091723cf1d45f6, the BlockBase creates views always asynchronously. And the oParentBlock is available in the onParentBlockModeChange handler of the controller.

return Controller.extend("...", {
  onParentBlockModeChange: function(sMode) {
    // this.oParentBlock is available here
  },
  // ...
});
Was this page helpful?
0 / 5 - 0 ratings