<?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: SAPUI5 runtime context and browser refresh in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460201#M4262684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 10.8px; color: #333333; background: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="63516" data-externalid="" data-presence="null" data-userid="1085422" data-username="sebastianraemsch" href="https://answers.sap.com/people/sebastianraemsch" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #3778c7; background: transparent;"&gt;Sebastian Raemsch&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im facing the same issue. &lt;/P&gt;&lt;P&gt;Your suggestion is working, but i want to change Json dynamically when its navigating from 1st view to 2nd view. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have posted new thread here &lt;A href="https://scn.sap.com/message/16511272#16511272" title="https://scn.sap.com/message/16511272#16511272"&gt;https://scn.sap.com/message/16511272#16511272&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me to resolve this issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Yokesvaran Kumarasamy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Feb 2016 08:12:13 GMT</pubDate>
    <dc:creator>former_member186566</dc:creator>
    <dc:date>2016-02-07T08:12:13Z</dc:date>
    <item>
      <title>SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaq-p/11460193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I observed the following behaviour: I created a navigation path and a number of models to be used in my App. The models are created in Component.js means centrally. I can easily access them from my MainView by this.getModel(). In the target View I am processing the model content. To access it there, I run&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var oModelAnchor = sap.ui.getCore().byId(cModelAnchorViewID);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var oModelL = oModelAnchor.getModel(cModelName);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cModelAnchorViewID is the view ID of the main View and cModelName is containing the name of the model. Modeltype is JSON the viewtypes are XML and javascript. Code works fine as long as I use the implemented sapui5 navigation functionality. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As soon as I am refreshing the page, when I am on the target view by using the browser refresh button, the runtime context changes. My anchor view is not longer accessible and the first line of code is returning undefined. To work around the problem I declared the model locally to this view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas why this happens? Obviously this behaviour is having significiant impact on how to implement value handling along navigation paths.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WPdat &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 14:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaq-p/11460193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-14T14:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460194#M4262677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why go through the view?&lt;/P&gt;&lt;P&gt;did you try to access model in your controller? this.getOwnerComponent().getModel()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460194#M4262677</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2016-01-14T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460195#M4262678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for replay. Good Point. The reason is, that I want to access i18n model in various scenarios. Access to it is not working in some of my views and especially not if I am opening a dialog window using a view. This view instance does even not have a &lt;SPAN style="color: #333333; font-size: 12px;"&gt; this.getOwnerComponent() method. Is there a way how to access this model independend from navigation status ? sap.ui.getCore().getModel(&amp;lt;modelName&amp;gt;) is not working this way. Using the proposed syntax "{i18n&amp;gt;textName}" leaves the text entities empty also. Any input is very welcome. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 08:41:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460195#M4262678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-18T08:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460196#M4262679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wolfgang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m not sure if this helps but I used&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;sap.ui.getCore().setModel()&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;sap.ui.getCore().getModel()&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;for my models which I have to access from different views. My development environment is currently broken so I cannot test if this solves the issue with page refresh. But maybe you give it a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 10:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460196#M4262679</guid>
      <dc:creator>sebastianraemsch</dc:creator>
      <dc:date>2016-01-18T10:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460197#M4262680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I had the same problem in my fiori launchpad because of change of id of the views when refreshing.What i did was i get the view id in onInit() method and used it.This solved my problem &lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 10:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460197#M4262680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-18T10:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460198#M4262681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your hint. Unluckily both methods do not return a valid model in the given runtime context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 07:11:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460198#M4262681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-19T07:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460199#M4262682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot. It is not selving the problem itself but it is usefull workaround. Quite helpfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 07:13:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460199#M4262682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-19T07:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460200#M4262683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wolfgang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today my dev environment is working again and I tested it.&lt;/P&gt;&lt;P&gt;In component.js I set a global model:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;// define a global model for global properties / attributes (global variables/ settings)&lt;/P&gt;
&lt;P&gt;var oGlobalProperties = {&lt;/P&gt;
&lt;P&gt;sServiceUrl: sServiceUrl,&lt;/P&gt;
&lt;P&gt;mockserver: {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; isStarted: bIsMocked&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;var oGlobalJSONModel = new sap.ui.model.json.JSONModel(oGlobalProperties);&lt;/P&gt;
&lt;P&gt;sap.ui.getCore().setModel(oGlobalJSONModel, "GlobalProperties");&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I can access the model from anywhere in my app by calling&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style="color: #222222; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt;sap.ui.getCore().getModel("GlobalProperties")&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, not sure what´s different in your app and what you exactly tried but this works for me and it works perfectly after refreshing the page by pressing F5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 15:05:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460200#M4262683</guid>
      <dc:creator>sebastianraemsch</dc:creator>
      <dc:date>2016-01-19T15:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 runtime context and browser refresh</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460201#M4262684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 10.8px; color: #333333; background: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="63516" data-externalid="" data-presence="null" data-userid="1085422" data-username="sebastianraemsch" href="https://answers.sap.com/people/sebastianraemsch" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #3778c7; background: transparent;"&gt;Sebastian Raemsch&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im facing the same issue. &lt;/P&gt;&lt;P&gt;Your suggestion is working, but i want to change Json dynamically when its navigating from 1st view to 2nd view. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have posted new thread here &lt;A href="https://scn.sap.com/message/16511272#16511272" title="https://scn.sap.com/message/16511272#16511272"&gt;https://scn.sap.com/message/16511272#16511272&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me to resolve this issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Yokesvaran Kumarasamy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Feb 2016 08:12:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-runtime-context-and-browser-refresh/qaa-p/11460201#M4262684</guid>
      <dc:creator>former_member186566</dc:creator>
      <dc:date>2016-02-07T08:12:13Z</dc:date>
    </item>
  </channel>
</rss>

