This question is a continuation of this one.
I have a list of SAPUI5 controls in string format and to extract the required control I use:
var sDefaultControlConstructor = "new sap.m.Input()";
var sConstructor = "return " + sDefaultControlConstructor;
var oConstructor = new Function(sConstructor);
var oField = oConstructor();
The oField
object I get looks like follows in the console:
M.c…s.f {bAllowTextSelection: true, mEventRegistry: Object, sId: "id", mProperties: d, mAggregations: Object…}
The problem is that I cannot get the created object using sap.ui.getCore().byId()
function.
I looked for the differences between the object I create and the object which is created "normally"
var oField = new sap.m.Input();
it looks like this:
d {bAllowTextSelection: true, mEventRegistry: Object, sId: "id", mProperties: d, mAggregations: Object…}
Obviously, these two object are different.
The question is how do I create the control of the second format using new Function()
.
Thank you.