Skip to Content
0
Former Member
Apr 10, 2014 at 01:01 PM

Query in creating a custom control

24 Views

Hi,

I am trying to create an custom control with two listboxes and two buttons to move list items between the two listboxes.

In the renderer of the control am creating, am looping through the array(which is sent as input to the custom control) to dynamically generate the list items.

When am sending an static array of data(json) as input, list items are getting created. But when a try to map result of an service, list items are not getting generated. Any help is much needed.

piece of code :

custom control usage :

var oListCustom1 = new myListControl({

listItemsArray: this.getList(), // which returns list of data from service(json type)

width: "400px",

height: "400px"

});

code in renderer :

renderer : {

render : function(oRm, oControl) {

var arrayItems = oControl.getListItemsArray();

arrayItems.forEach(function (column) {

console.log("column..."+column.value);

oControl.getAggregation("_SourceList").addItem(new sap.ui.core.ListItem({text : column.value, key : column.value}));

});

}

}

Thanks in advance.