<?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: library preload in controller using sap.ui.define in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058166#M4505992</link>
    <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/91110/pradeeptn.html"&gt;Pradeep T N&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;See the below example, they just used "sap.viz":{}&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/entity/sap.viz.ui5.controls.VizFrame/sample/sap.viz.sample.Area/code/manifest.json"&gt;https://ui5.sap.com/#/entity/sap.viz.ui5.controls.VizFrame/sample/sap.viz.sample.Area/code/manifest.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can pass lazy as true and it will not load it immediately, it will load it whenever the app requests for the ui5 resources. Check my original answer links for more info.&lt;/P&gt;&lt;P&gt;Now the above code will send a request to load the preload file of sap.viz automatically, you don't need to to explicitly mention that and I doubt it works if you mention it like that.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 04:24:41 GMT</pubDate>
    <dc:creator>maheshpalavalli</dc:creator>
    <dc:date>2019-10-09T04:24:41Z</dc:date>
    <item>
      <title>library preload in controller using sap.ui.define</title>
      <link>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaq-p/12058163</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;We are using viz controls to build charts, and I observed that we are using 32 controls from the same library.&lt;/P&gt;
  &lt;P&gt;But I can't do library preload at index html or bootstrap level, because the framework that we are using is re-used across multiple application and many of those are not using viz library.&lt;/P&gt;
  &lt;P&gt;So, I tried loading the library-preload.js in the controller where the chart are used. Below is the code snippet of the same.&lt;/P&gt;
  &lt;P&gt;Please suggest is it fine to use this way.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;sap.ui.define([ "sap/ui/core/mvc/Controller", "sap/m/IconTabFilter", "sap/ui/model/json/JSONModel", "sap/viz/library-preload" ], function(Controller,
IconTabFilter, JSONModel, vizLib) {


});&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;This is avoiding 30+ requests as all required controls are loaded in a single file.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 08:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaq-p/12058163</guid>
      <dc:creator>former_member258862</dc:creator>
      <dc:date>2019-09-26T08:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: library preload in controller using sap.ui.define</title>
      <link>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058164#M4505990</link>
      <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/91110/pradeeptn.html"&gt;Pradeep T N&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You don't need to load preload file explicitly. UI5 framework automatically sends a request and loads it for us. So just use the normal namespace, which should be enough.&lt;/P&gt;&lt;P&gt;Your code looks fine and it will load the requests once that particular view is loaded. If you want to load the libraries manually when you need, then use this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/api/sap.ui/methods/sap.ui.require"&gt;https://ui5.sap.com/#/api/sap.ui/methods/sap.ui.require&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Else you can also use the library at the manifest.json but pass the lazy as true. So only when the viz frame is required, it will be loaded.&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/topic/8521ad1955f340f9a6207d615c88d7fd"&gt;https://ui5.sap.com/#/topic/8521ad1955f340f9a6207d615c88d7fd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 15:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058164#M4505990</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2019-09-26T15:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: library preload in controller using sap.ui.define</title>
      <link>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058165#M4505991</link>
      <description>&lt;P&gt;Hello   &lt;SPAN class="mention-scrubbed"&gt;maheshkumar.palavalli&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;I didn't understand part of your answer "You don't need to load preload file explicitly. UI5 framework automatically sends a request and loads it for us. So just use the normal namespace, which should be enough".&lt;/P&gt;&lt;P&gt;What do you mean by using namespace? Can you please share a sample code snippet.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Pradeep&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 04:05:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058165#M4505991</guid>
      <dc:creator>former_member258862</dc:creator>
      <dc:date>2019-10-09T04:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: library preload in controller using sap.ui.define</title>
      <link>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058166#M4505992</link>
      <description>&lt;P&gt;Hi &lt;A href="https://answers.sap.com/users/91110/pradeeptn.html"&gt;Pradeep T N&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;See the below example, they just used "sap.viz":{}&lt;/P&gt;&lt;P&gt;&lt;A href="https://ui5.sap.com/#/entity/sap.viz.ui5.controls.VizFrame/sample/sap.viz.sample.Area/code/manifest.json"&gt;https://ui5.sap.com/#/entity/sap.viz.ui5.controls.VizFrame/sample/sap.viz.sample.Area/code/manifest.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can pass lazy as true and it will not load it immediately, it will load it whenever the app requests for the ui5 resources. Check my original answer links for more info.&lt;/P&gt;&lt;P&gt;Now the above code will send a request to load the preload file of sap.viz automatically, you don't need to to explicitly mention that and I doubt it works if you mention it like that.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 04:24:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/library-preload-in-controller-using-sap-ui-define/qaa-p/12058166#M4505992</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2019-10-09T04:24:41Z</dc:date>
    </item>
  </channel>
</rss>

