I created two custom control. First custom control includes the other one as a multiple. And I want to use them in my XML view as below:
<foo:Foo>
<foo:FooItem>
</foo:FooItem>
<foo:FooItem>
</foo:FooItem>
</foo:Foo>
And I created my parent custom control Foo to create FlexBox holding my child controls.
My Foo metadata :
metadata:
{
properties:
{
"title": {type : "string", group : "Misc", defaultValue : ""}
},
aggregations :
{
content: {singularName: "content"}
},
defaultAggregation: "content"
}
and my Foo renderer:
renderer :
{
render : function(oRm, oControl) {
console.log("inoart.controls.Gauge.render()");
var layout = oControl.createLayout();//creates FlexBox
oRm.write("<div");
oRm.writeControlData(oControl);
oRm.writeClasses();
oRm.write(">");
oRm.renderControl(layout);
var aChildren = oControl.getContent();
for (var i = 0; i < aChildren.length; i++)
{ // loop over all child Controls,
oRm.write("<div>");
oRm.writeStyles();
layout.addItem(aChildren[i]);
// I tried to add my child controls to this layout!!!
oRm.renderControl(aChildren[i]);
oRm.write("</div>");
}
oRm.addClass('verticalAlignment');
oRm.write("</div>");
}
}
and my view looks like this:
<controls.Foo id="__Foo0">
<sap.m.FlexBox id="__box0">
<controls.FooItem id="__fooItem0">
<sap.m.VBox id="__vbox0">
<sap.m.FlexBox id="__box1">
<controls.FooItem id="__fooItem1">
<sap.m.VBox id="__vbox1">
<sap.m.FlexBox id="__box2">
but I want it to be like this:
<controls.Foo id="__Foo0">
<sap.m.FlexBox id="__box0">
<controls.FooItem id="__fooItem0">
<sap.m.VBox id="__vbox0">
<sap.m.FlexBox id="__box1">
<controls.FooItem id="__fooItem1">
<sap.m.VBox id="__vbox1">
<sap.m.FlexBox id="__box2">