Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to bind text field value from selected row of sap.m.table values in same view


Please share if there is any sample project/code to bind text field value from selected row of sap.m.table values in same view.

I was able to achieve this if text field is in different view by transferring context like this from controller.

handleListItemPress : function(evt) {

  var context = evt.getSource().getBindingContext();"Detail", context);

I am using single XML View and Controller .

I was able to read the data from selected row as well but unable to use it to set those values for other UI Elements.

Used below code to read selected row data.

onSelectionChange: function(oEvent){

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

  var oSelectedItemContext = oSelectedItem.getBindingContext();

  var sTableMode = oSelectedItem._mode;

  var sId = oSelectedItem.getBindingContext().getProperty("id");

    var sName = oSelectedItem.getBindingContext().getProperty("Name");

    var age = oSelectedItem.getBindingContext().getProperty("Age");




Koti Reddy

Former Member
Former Member replied

I was able to use bind text fields/text using setTitle , setValue methods.Earlier I faced difficulty to set dynamic values of table selected row due to limitations to pass data between different layout controls.

Used below code from controller after modifying existing xml view under single layout control.








Koti Reddy

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question