<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Get row from Table in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaa-p/371330#M28686</link>
    <description>&lt;P&gt;Thank you very much!!!! It works:) &lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2016 12:34:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-11-11T12:34:15Z</dc:date>
    <item>
      <title>Get row from Table</title>
      <link>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaq-p/371328</link>
      <description>&lt;P&gt;Hi! &lt;/P&gt;
  &lt;P&gt;I want to get a row and put in Object Header.&lt;/P&gt;
  &lt;P&gt;It's my Object Header&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;	&amp;lt;ObjectHeader id="title" title=" {Kokrs} {Obart} {Layout} ( {Pjahr} / {Version} ) " introActive="false" titleActive="false" iconActive="false" backgroundDesign="Solid"&amp;gt;
						&amp;lt;attributes&amp;gt;
							&amp;lt;ObjectAttribute active="false"/&amp;gt;
							&amp;lt;ObjectAttribute active="false"/&amp;gt;
						&amp;lt;/attributes&amp;gt;
					&amp;lt;/ObjectHeader&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I select a row in a table and would like to put this row in Object Header&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/5945-3.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Right now I get my data from table to this labels below Object Header by this way...But I have no idea how can I get object header from a table.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;	var oSelectedItem = oEvent.getParameter("listItem") || oEvent.getSource().getSelectedItem().getBindingContext();
	
			
			var s1t = oSelectedItem.getBindingContext().getProperty("Status01Text");
			var oText = this.getView().byId("s1t");
			oText.setText(s1t);
			//Status01
			var s1 = oSelectedItem.getBindingContext().getProperty("Status01");
			var oText = this.getView().byId("s1");
			oText.setText(s1);


			var s1p = oSelectedItem.getBindingContext().getProperty("Status01Perc");
			var oText = this.getView().byId("s1p");
			oText.setText(s1p);
			//Status02		
			var s2t = oSelectedItem.getBindingContext().getProperty("Status02Text");
			var oText = this.getView().byId("s2t");
			oText.setText(s2t);


			var s2 = oSelectedItem.getBindingContext().getProperty("Status02");
			var oText = this.getView().byId("s2");
			oText.setText(s2);


			var s2p = oSelectedItem.getBindingContext().getProperty("Status02Perc");
			var oText = this.getView().byId("s2p");
			oText.setText(s2p);
			//Status03
			var s3t = oSelectedItem.getBindingContext().getProperty("Status03Text");
			var oText = this.getView().byId("s3t");
			oText.setText(s3t);


			var s3 = oSelectedItem.getBindingContext().getProperty("Status03");
			var oText = this.getView().byId("s3");
			oText.setText(s3);


			var s3p = oSelectedItem.getBindingContext().getProperty("Status03Perc");
			var oText = this.getView().byId("s3p");
			oText.setText(s3p);


			//status04


			var s4t = oSelectedItem.getBindingContext().getProperty("Status04Text");
			var oText = this.getView().byId("s4t");
			oText.setText(s4t);


			var s4 = oSelectedItem.getBindingContext().getProperty("Status04");
			var oText = this.getView().byId("s4");
			oText.setText(s4);


			var s4p = oSelectedItem.getBindingContext().getProperty("Status04Perc");
			var oText = this.getView().byId("s4p");
			oText.setText(s4p);


			//Status05


			var s5t = oSelectedItem.getBindingContext().getProperty("Status05Text");
			var oText = this.getView().byId("s5t");
			oText.setText(s5t);


			var s5 = oSelectedItem.getBindingContext().getProperty("Status05");
			var oText = this.getView().byId("s5");
			oText.setText(s5);


			var s5p = oSelectedItem.getBindingContext().getProperty("Status05Perc");
			var oText = this.getView().byId("s5p");
			oText.setText(s5p);


			//Status 06


			var s6t = oSelectedItem.getBindingContext().getProperty("Status06Text");
			var oText = this.getView().byId("s6t");
			oText.setText(s6t);


			var s6 = oSelectedItem.getBindingContext().getProperty("Status06");
			var oText = this.getView().byId("s6");
			oText.setText(s6);


			var s6p = oSelectedItem.getBindingContext().getProperty("Status06Perc");
			var oText = this.getView().byId("s6p");
			oText.setText(s6p);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Nov 2016 10:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaq-p/371328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-11T10:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get row from Table</title>
      <link>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaa-p/371329#M28685</link>
      <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/11416/kfilonchik.html"&gt;Khristina&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;i don't understand your exact requirement , but i think you are asking how to get the data from the selected record of the table and attach to the object header (assuming object header is in the same view as of table). For  sap.m.table there is a event selectionChange (call onRecordSelection function handler) you need to use that to  get the selected data record &lt;/P&gt;&lt;P&gt;controller : &lt;/P&gt;&lt;P&gt;onRecordSelection:function(oEvent){&lt;/P&gt;&lt;P&gt;var data = oEvent.getParameter("listItem").getBindingContext(&amp;lt;modelName if mentioned while attaching model to table&amp;gt;).getProperty();&lt;/P&gt;&lt;P&gt;// data contains all the row fields of the selected row , after getting attach it to the object header &lt;/P&gt;&lt;P&gt;var model = new sap.ui.model.json.JSONModel();// creating json model&lt;/P&gt;&lt;P&gt;model.setData({selectedSet:data});//attaching selected row data to the model&lt;/P&gt;&lt;P&gt;this.getView().byId("&amp;lt;id of object header&amp;gt;").setModel(model);//attach model to the control(object header in your case)&lt;/P&gt;&lt;P&gt;this.getView().byId("&amp;lt;id of object header&amp;gt;").bindElement("/selectedSet");// binding object to the control  &lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;Note: In above case tableitems attached fieldsNames and object header propertyNames needs to be same &lt;/P&gt;&lt;P&gt;i hope this helps , let me know if you face any issues after this too .&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Viplove&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 12:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaa-p/371329#M28685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-11T12:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get row from Table</title>
      <link>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaa-p/371330#M28686</link>
      <description>&lt;P&gt;Thank you very much!!!! It works:) &lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 12:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/get-row-from-table/qaa-p/371330#M28686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-11T12:34:15Z</dc:date>
    </item>
  </channel>
</rss>

