<?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: Fiori - Rebind Line Item after Function Import in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609632#M146178</link>
    <description>&lt;P&gt;Thank you Cristian, but I try to refresh binding on LineItem from annotation and, now, syntax getBinding("items") does not work &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;I am still working on it.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks again for helping &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 06:14:26 GMT</pubDate>
    <dc:creator>alexandredoyen</dc:creator>
    <dc:date>2018-06-29T06:14:26Z</dc:date>
    <item>
      <title>Fiori - Rebind Line Item after Function Import</title>
      <link>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaq-p/609630</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I am facing a new challenge "rebind a list with updated data from BackEnd". I have a list report &amp;amp; object page (OP).&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;In my OP. I added a custom action link to a Function Import. This function call backend and get updated data.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Here my problem, how refresh/rebind to my LineItem the new data ??&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Version 1.38&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Here my annotation file&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/161555-capture.png" /&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Some code below&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;OnActionItemsRefresh: function(oEvent) {
	var oBindingContext = oEvent.getSource().getBindingContext();
	var sObjectPageData = oBindingContext.getModel().getProperty(oBindingContext.getPath());
	var vFunctionName = "/ActionItemsRefresh";
	var mParameters = {
		"INVOICE": sObjectPageData.Invoiceid,
		"FISCALYEAR": sObjectPageData.Fiscalyearid
	};


	// var oData = this.extensionAPI.invokeActions(vFunctionName,this.extensionAPI.getSelectedContexts(),mParameters);
	var that = this;


	try {
		oBindingContext.getModel().callFunction(vFunctionName, {
			method: "GET",
			urlParameters: mParameters,
			success: function(oData, response) {
			//	console.log(oData.results);
			that.extensionAPI.rebind("InvoiceItems");
			},
			error: function(oError) {
				// console.log(oError);
			}
		});
	} catch (ex) {
		// console.log(ex);
	}
	}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;If you have any advice or answer ? &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thank you very much !!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 14:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaq-p/609630</guid>
      <dc:creator>alexandredoyen</dc:creator>
      <dc:date>2018-06-15T14:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Fiori - Rebind Line Item after Function Import</title>
      <link>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609631#M146177</link>
      <description>&lt;P&gt;An easy way to refresh the list is:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;this.byId("iList").getBinding("items").refresh();&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 07:53:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609631#M146177</guid>
      <dc:creator>CristianBabei</dc:creator>
      <dc:date>2018-06-18T07:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fiori - Rebind Line Item after Function Import</title>
      <link>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609632#M146178</link>
      <description>&lt;P&gt;Thank you Cristian, but I try to refresh binding on LineItem from annotation and, now, syntax getBinding("items") does not work &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;I am still working on it.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks again for helping &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 06:14:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609632#M146178</guid>
      <dc:creator>alexandredoyen</dc:creator>
      <dc:date>2018-06-29T06:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fiori - Rebind Line Item after Function Import</title>
      <link>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609633#M146179</link>
      <description>&lt;P&gt;Finally, with Cristian help, I did it. Below my code for help others.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;OnActionItemsRefresh: function(oEvent) {
	// Some var to get Id of LineItems, binding and key of entity
        var vTableId = oEvent.getSource().getParent().getParent().getId();
	var oBindingContext = oEvent.getSource().getBindingContext();
	var sObjectPageData = oBindingContext.getModel().getProperty(oBindingContext.getPath());
	// Create a filter to apply ActionRefresh
	var aFilters = [];
	var oFilter = new sap.ui.model.Filter("Invoiceid", sap.ui.model.FilterOperator.EQ, sObjectPageData.Invoiceid);
	aFilters.push(oFilter);
	oFilter = new sap.ui.model.Filter("Fiscalyearid", sap.ui.model.FilterOperator.EQ, sObjectPageData.Fiscalyearid);
	aFilters.push(oFilter);
	oFilter = new sap.ui.model.Filter("Actionrefresh", sap.ui.model.FilterOperator.EQ, "'X'");
	aFilters.push(oFilter);

	// Apply filter and let backend works !
	this.byId(vTableId).getTable().getBinding("items").filter(new sap.ui.model.Filter(aFilters, true));
}

&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 13:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/fiori-rebind-line-item-after-function-import/qaa-p/609633#M146179</guid>
      <dc:creator>alexandredoyen</dc:creator>
      <dc:date>2018-06-29T13:37:06Z</dc:date>
    </item>
  </channel>
</rss>

