Skip to Content
author's profile photo Former Member
Former Member

Could not select the item value from table

Hi Expert,

I could not able to select the item property from a table when I select the table line item. Please check my below code.

Table:

Under View:

Template to map the data to the respective column

var template = new sap.m.ColumnListItem({

id: "first_template",

type: "Navigation",

visible: true,

cells: [

new sap.m.Label("ID", {

text: "{M1>Vbeln}"

}),

new sap.m.Label({

text: "{M1>Kunnr}"

}),

new sap.m.Label({

text: "{M1>Total}"

})

]

});

oTable.bindItems( "M1>/HeaderSet",template, null, oFilters);

Under Controller on Press event handler:

var oSelectedItem = evt.getParameter("listItem");

Here I got the reference to oSelectedItem( checked it in debug mode), but i could not able to read Vbeln data when I press the lineitem.

var sItemName = oSelectedItem.getBindingContext().getProperty("Vbeln");

alert(sItemName);

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 07, 2016 at 11:28 AM

    Hi k p,

    You have a model name, try:

    var sItemName = oSelectedItem.getBindingContext("M1").getProperty("Vbeln");
    

    Regards,

    Sai.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.