Quantcast
Viewing all articles
Browse latest Browse all 5806

CustomData Problem in List

Hi,

we are creating a UI5 Application, but I have one problem...

 

I have created a List within the controller, this list is not in binding with the model. Its filled dynamically:

 

$.each($(functionsXMLModel.getXML()).find('OBJECTREFERENCE'), function(index, item){

  if ($(item).find('BP_TYPE').text()=='CM_ALERT') {

  var title = $(item).find('DESCRS').text();

  var link = $(item).attr('href');

  var anAlert = {title:title, link:link};

  var oItemTemplate = new sap.m.StandardListItem({title:title});

  var oDataTemplate = new sap.ui.core.CustomData({key:"href"});

  oDataTemplate.bindProperty("value", link);

  oItemTemplate.addCustomData(oDataTemplate);

  alertList.addItem(oItemTemplate);

  }

  });

 

When clicking the listitem I always get null from the listItem.data:

 

openAlert: function(oEv) {
console.log("openAlert");
var item = oEv.getParameters("alertList");
console.log(oEv.getParameters("alertList"));
console.log(item.listItem.data());
//console.log(oEv.getParameter("alertList").getBindingContext());
}

 

Does the binding didn't work within this context, or did I miss something?

 

Thanks in advance, Chris


Viewing all articles
Browse latest Browse all 5806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>