Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8436

How to get text out of customlistitem

$
0
0

Hi

 

I am trying to get data on press event.

I tried to follow this http://jsbin.com/openui5-mobile-list-databinding/2/edit

Since it is standardlistitem I cannot put lot of data in an item, So I used a customlistitem. Here on press event I am trying to get the text present in it.

 

var  list1 = new sap.m.CustomListItem( {

  id : "list1",

  type: sap.m.ListType.Navigation,

  content:[new sap.m.Text({text:"{Kunnr}"}) ] ,

  press:function(evt){

  var control = evt.getSource().getContent().getText();

  alert(control);

  }

  }) 

 

 

I not able to get any alert.

And If I use  evt.getSource().getContent() I am getting  Element sap.m.Text#_text0-_clone 0 in the alert..

Can someone help me out with this.

ScreenHunter_02 Oct. 11 23.51.jpg


Viewing all articles
Browse latest Browse all 8436

Trending Articles



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