Skip to Content
0

Custom Control with multiple aggregation doesn't render anything

Mar 09, 2017 at 07:08 PM

35

avatar image
Former Member

Hi all,

I am working on creating a custom control. The control accepts an aggregation called "documents" with cardinality 0..n.

var TagTab = Control.extend("sap.ui.demo.DocTab", { metadata: { library: "sap.m", properties: { expandable : {type : "boolean", group : "Misc", defaultValue : true}, expanded : {type : "boolean", group : "Misc", defaultValue : true} }, defaultAggregation: "documents", aggregations: { documents: {type: "sap.m.IconTabFilter", multiple: true, singularName: "item"} } } });

Now I am using this control in XML view like this:

<DocTab items="{/docs}">

<m:IconTabFilter text="{docName}" ></m:IconTabFilter>

</DocTab>

But nothing gets rendered on the screen. I tried checking the binding in render function of the control using : console.log(oControl.getDocuments()) but this returns null.

What else do we need to implement in order to get the multiple aggregation working ? Currently I don't have anything apart from control metadata and render fucntion.

Thanks

Shruti

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

1 Answer

Srikanth KV Mar 09, 2017 at 07:13 PM
0

have you tested the UI control with hardcoded data?, if not then test that once...

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yes, it works fine with the hard-coded data. Its just when I introduce binding .. it stops working

I have checked the same binding with a stanadrd control and works fine there.

0

show UI control code..especially render.js

0