on 04-25-2016 10:21 AM
Hi all, does anyone know how I can get a sapui5 control (viz) declared in a xml block from js block ? I tried with sapui.getCore ().byId (), this.getView (). byId (), but does not work
ABlock.xml
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:layout="sap.ui.layout" xmlns:forms="sap.ui.layout.form" xmlns="sap.m" xmlns:viz="sap.viz.ui5.controls" >
<viz:VizFrame xmlns="sap.viz" id="idviz" >
</viz:VizFrame>
</mvc:View>
ABlock.js
jQuery.sap.declare("block.ABlock");
jQuery.sap.require("sap.uxap.BlockBase");
sap.uxap.BlockBase.extend("block.AditionalBlock", {
metadata: {
views: {
Collapsed: {
viewName: "block.ABlock",
type: "XML"
},
Expanded: {
viewName: "block.ABlock",
type: "XML"
}
}
},
onAfterRendering: function() {
var oVizFrame = sap.ui.getCore().byId("idviz"); //undefined
.......
}
});
Thanks in advance
Did you get any solution for this problem? I am facing the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems the problem is that the framework will override the id of the control with viewId + "--" + id.
I just had to find it (plugin UI5 in chrome) and sap.ui.getCore().byId(viewId + "--" + id).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.