Skip to Content

Edit/Display mode for Object Page Blocks (UI5)

Nov 07, 2016 at 02:12 PM


avatar image
Former Member

Hello colleagues,

Could you help me with the Object Page Block (BlockBase.js) mode property?

When I click at the edit button in the object page layout, I wanted to change some of the blocks, which contain forms from display to change mode and backwards. In the 1.40 version of API, the following written about getMode() method of BlockBase:

The mode of the block is changed when SubSection mode changes.

Sub Section Mode has only to values to select from: Collapsed and Expanded (sap.uxap.ObjectPageSubSectionMode).

How do I set other view for other modes?

Now, I do it like that:

	var newBlock = BlockBase.extend("...newBlock", {
		metadata: {
			views: {
				Expanded: {
					viewName: "...DisplayBlock",
					type: "XML"
				Collapsed: {
					viewName: "...DisplayBlock",
					type: "XML"
				Display: {
					viewName: "...DisplayBlock",
					type: "XML"					
				Edit: {
					viewName: "...ChangeBlock",
					type: "XML"		

Then, I change mode property in the controller:


It works but...What's a proper way?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers