openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

ObjectPage: async creation of block views

Open whydrae opened this issue 8 years ago • 6 comments

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:

		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!

whydrae avatar Nov 30 '18 11:11 whydrae

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

GeorgiValkanov avatar Nov 30 '18 13:11 GeorgiValkanov

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

Thanks, Georgi

GeorgiValkanov avatar Feb 07 '19 08:02 GeorgiValkanov

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

whydrae avatar Feb 18 '19 08:02 whydrae

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

jdichev avatar Feb 27 '19 11:02 jdichev

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

grischan avatar Apr 17 '19 13:04 grischan

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
  },
  // ...
});

boghyon avatar May 15 '19 11:05 boghyon