on 11-07-2016 2:12 PM
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:
this.getView().byId("newBlock").setMode("Edit");
It works but...What's a proper way?
Thanks,
Ilya
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.