<?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: Element Binding .refresh( ) does not work after SAPUI5 upgrade in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660475#M4749786</link>
    <description>&lt;P&gt;Thanks a lot, I will try that.&lt;/P&gt;&lt;P&gt;I had already tried unbindElement( ), but it didn't do anything.&lt;/P&gt;&lt;P&gt;Do you have other examples of proper controller logic? I feel like many of us could use more examples, as there are so many different ways of doing things. I've been looking in Github for examples but it's hard to find what youre looking for.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 17:09:43 GMT</pubDate>
    <dc:creator>RaminS</dc:creator>
    <dc:date>2023-04-25T17:09:43Z</dc:date>
    <item>
      <title>Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaq-p/12660473</link>
      <description>&lt;P&gt;We have a bunch of custom free-style Fiori apps created a few years ago, that contain code like this in the attachPatternMatched method of the router object:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;var oElementBinding = this.getView().getElementBinding();
if ( oElementBinding.getBoundContext() ) {
	oElementBinding.refresh(); 
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;This is to ensure if the user navigates away and then back to an Object page, the view's elementBinding gets refreshed from the backend (because view.bindElement( ) does not call the backend if user navigates away then back to the object page).&lt;/P&gt;
  &lt;P&gt;This has worked fine so far until we upgraded to SAPUI5 1.71.53 (from 1.71.48), and now it doesn't refresh.&lt;/P&gt;
  &lt;P&gt;We found that if we add the parameter true, it works as before:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;oElementBinding.refresh(true); &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Now, I know we should have had the "true" parameter from the start, but why would that make a difference in 1.71.53, and not 48. The parameter is supposed to only matter if the model has not changed, in our cases the model has changed, so the refresh should work even without the parameter.&lt;/P&gt;
  &lt;P&gt;Would appreciate any recommendations, on what the proper way is to ensure models are updated as user navigates between pages.&lt;/P&gt;
  &lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 16:06:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaq-p/12660473</guid>
      <dc:creator>RaminS</dc:creator>
      <dc:date>2023-04-25T16:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660474#M4749785</link>
      <description>&lt;P&gt;Assuming the "model" is of type v2.ODataModel, you can ensure that the bound context fetches always the entity from the OData service by calling sap.ui.model.odata.v2.ODataModel#&lt;STRONG&gt;invalidateEntry&lt;/STRONG&gt; before bindElement (or bindObject). &lt;/P&gt;&lt;P&gt;See my other &lt;A href="https://stackoverflow.com/a/59398119/5846045"&gt;answer at "How to refresh previously bound entity every time user visits the page?"&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Most of the times, Model#refresh is not required.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 16:55:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660474#M4749785</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2023-04-25T16:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660475#M4749786</link>
      <description>&lt;P&gt;Thanks a lot, I will try that.&lt;/P&gt;&lt;P&gt;I had already tried unbindElement( ), but it didn't do anything.&lt;/P&gt;&lt;P&gt;Do you have other examples of proper controller logic? I feel like many of us could use more examples, as there are so many different ways of doing things. I've been looking in Github for examples but it's hard to find what youre looking for.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 17:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660475#M4749786</guid>
      <dc:creator>RaminS</dc:creator>
      <dc:date>2023-04-25T17:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660476#M4749787</link>
      <description>&lt;P&gt;I'm curious, how does this refreshing happen in SAP's List Report template? Do they use &lt;STRONG&gt;invalidateEntry&lt;/STRONG&gt; in the object page to make sure it refreshes when user navigates from worklist to Object? And how do they ensure Worklist gets refreshed when the user edits something in the Object page? .... Do they use eventBus subscribe/publish events? How do they ensure models get refreshed at the right time?&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 20:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660476#M4749787</guid>
      <dc:creator>RaminS</dc:creator>
      <dc:date>2023-04-25T20:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660477#M4749788</link>
      <description>&lt;P&gt;Hi Ramin,&lt;/P&gt;&lt;P&gt;As per my knowledge the refresh() function fetches data from the back end service and updates the model. It doesn't update the bound controls.&lt;/P&gt;&lt;P&gt;In case you need to update the controls that are are bound to this model,whose data has been changed, you need to pass in the true parameter which forces the controls to be updated.&lt;/P&gt;&lt;P&gt;I think your apps needs to update the bound controls with new data and hence this param would be needed to do so. Without this, your model would definitely show the changes but control would not.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shobhit Pathak&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 22:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660477#M4749788</guid>
      <dc:creator>shobhit2108</dc:creator>
      <dc:date>2023-04-25T22:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660478#M4749789</link>
      <description>&lt;P&gt;Are you saying this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;this.getView().getElementBinding().refresh(); &lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;does not refresh the view controls?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 19:40:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660478#M4749789</guid>
      <dc:creator>RaminS</dc:creator>
      <dc:date>2023-04-26T19:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660479#M4749790</link>
      <description>&lt;P&gt;Hey Ramin,&lt;/P&gt;&lt;P&gt;As per my knowledge, the code you mentioned should refresh the control (without true parameter) with latest data in the model if the data has changed, provided the binding in proper.&lt;/P&gt;&lt;P&gt;I am not sure as to why it is not working in a specific version but in case if you need to force refresh, you can use the true parameter to refresh the control with latest fetched data.&lt;/P&gt;&lt;P&gt;I think your understanding is correct for the refresh() method and maybe you might need to open a ticket with concerned product team for this specific template issue.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shobhit Pathak&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 22:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660479#M4749790</guid>
      <dc:creator>shobhit2108</dc:creator>
      <dc:date>2023-04-26T22:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Element Binding .refresh( ) does not work after SAPUI5 upgrade</title>
      <link>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660480#M4749791</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;ramin.shafai&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Templates from SAP Fiori elements (FE) are not really comparable with rather simple freestyle apps since FE implements a number of additional features, such as &lt;EM&gt;draft handling&lt;/EM&gt;, &lt;EM&gt;side effects&lt;/EM&gt;, refreshing in &lt;EM&gt;sap-keep-alive&lt;/EM&gt;, etc., that affect the object page or any other bound elements.&lt;/P&gt;&lt;P&gt;We can see in the current FE V2 source code that invalidateEntry &lt;STRONG&gt;is one of the approaches&lt;/STRONG&gt; the Object Page uses to refresh itself unconditionally.&lt;/P&gt;&lt;P&gt;Having to "ensure models get refreshed at the right time" sounds like the application is incorrectly applying changes typically via private properties or unbound model paths. If you need more help, we'd need to look at the application code in a new question.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2023 20:43:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/element-binding-refresh-does-not-work-after-sapui5-upgrade/qaa-p/12660480#M4749791</guid>
      <dc:creator>boghyon</dc:creator>
      <dc:date>2023-04-29T20:43:11Z</dc:date>
    </item>
  </channel>
</rss>

