<?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>topic Hi Brandon, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026514#M40315</link>
    <description>&lt;P&gt;Hi Brandon,&lt;/P&gt;

&lt;P&gt;I split my &lt;EM&gt;index.html &lt;/EM&gt;into &lt;EM&gt;index.html &lt;/EM&gt;and &lt;EM&gt;main.html, &lt;/EM&gt;such that the new &lt;EM&gt;index.html &lt;/EM&gt;has a single page for the login along with all the headers and footers, and &lt;EM&gt;main.html &lt;/EM&gt;contains all other pages and their subpages. I also made 2 changes to&amp;nbsp;&lt;EM&gt;main.html:&amp;nbsp;&lt;/EM&gt;(1) removed id="afui" on &amp;lt;body&amp;gt;; (2) removed the "content" &amp;lt;div&amp;gt; as it would hide pages when main.html is inserted.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;When login is successful, I loadContent("main.html",...).&amp;nbsp;This delays calling web services and renders the first page in &lt;EM&gt;main.html. &amp;nbsp;&lt;/EM&gt;This would solve my original problem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;However, navigating to other pages would fail, because it appears other pages except the first one in &lt;EM&gt;main.html&amp;nbsp;&lt;/EM&gt;are not inserted in DOM.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Is there an example of using multiple html files somewhere? Appreciate if you could set me straight. Thanks!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2015 03:17:07 GMT</pubDate>
    <dc:creator>Yonghong_R_</dc:creator>
    <dc:date>2015-07-28T03:17:07Z</dc:date>
    <item>
      <title>How to force a listview repopulate with web service data in XDK?</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026511#M40312</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I have listviews that are populated with data from a web service. When the app loads, it calls web services to populate the listviews. This is working fine until I enabled login verification. &amp;nbsp;With login verification, app gets empty data when it loads as the user hasn't logged in yet. The first screen of the app is to prompt for login. Once login is successful, I need to force those listviews that got empty data to be populated with real data. How should one accomplish that?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;"data-driving" feature clearly can trigger web service updates.&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Can one leverage this mechanism?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Basically I am looking for a solution within the XDK's web service support framework. If XDK's web service doesn't support a simple way of doing this, then I guess I should directly call web service and update DOM nodes with data.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Appreciate any suggestions and advice. Thanks in advance.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 22:48:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026511#M40312</guid>
      <dc:creator>Yonghong_R_</dc:creator>
      <dc:date>2015-07-26T22:48:21Z</dc:date>
    </item>
    <item>
      <title>How did you build your</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026512#M40313</link>
      <description>&lt;P&gt;How did you build your application? Why can't you wait to load those list views until after the user logs in?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 21:16:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026512#M40313</guid>
      <dc:creator>Brandon_K_Intel</dc:creator>
      <dc:date>2015-07-27T21:16:48Z</dc:date>
    </item>
    <item>
      <title>Hi Brandon,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026513#M40314</link>
      <description>&lt;P&gt;Hi Brandon,&lt;/P&gt;

&lt;P&gt;Thanks for your reply.&lt;/P&gt;

&lt;P&gt;The application is a single index.html file with a set of JS files etc. I am using Intel App Framework, with Angular (also used Backbone for a while) for web service. The app is developed and built in XDK. I hope I understood your question on building application correctly.&lt;/P&gt;

&lt;P&gt;Your second question makes me to think that perhaps having a single HTML file is the problem. With a single HTML file, at initialization the app tries to resolve everything in the HTML and calls web services (with Angular it calls the ng-controllers, and with Backbone I am not sure how it's done but it's done). &amp;nbsp;So perhaps the right way is to have a login.html to process login only and then loadContent the main html file? &amp;nbsp;It sounds like I organized the app wrong.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Would love to hear your further advice. In the meanwhile, I will try splitting index.html into login.html and main.html and load the second with something like:&lt;/P&gt;

&lt;P&gt;af.ui.loadContent("main.html", FALSE, FALSE, "pop", TRUE);&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 22:05:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026513#M40314</guid>
      <dc:creator>Yonghong_R_</dc:creator>
      <dc:date>2015-07-27T22:05:26Z</dc:date>
    </item>
    <item>
      <title>Hi Brandon,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026514#M40315</link>
      <description>&lt;P&gt;Hi Brandon,&lt;/P&gt;

&lt;P&gt;I split my &lt;EM&gt;index.html &lt;/EM&gt;into &lt;EM&gt;index.html &lt;/EM&gt;and &lt;EM&gt;main.html, &lt;/EM&gt;such that the new &lt;EM&gt;index.html &lt;/EM&gt;has a single page for the login along with all the headers and footers, and &lt;EM&gt;main.html &lt;/EM&gt;contains all other pages and their subpages. I also made 2 changes to&amp;nbsp;&lt;EM&gt;main.html:&amp;nbsp;&lt;/EM&gt;(1) removed id="afui" on &amp;lt;body&amp;gt;; (2) removed the "content" &amp;lt;div&amp;gt; as it would hide pages when main.html is inserted.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;When login is successful, I loadContent("main.html",...).&amp;nbsp;This delays calling web services and renders the first page in &lt;EM&gt;main.html. &amp;nbsp;&lt;/EM&gt;This would solve my original problem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;However, navigating to other pages would fail, because it appears other pages except the first one in &lt;EM&gt;main.html&amp;nbsp;&lt;/EM&gt;are not inserted in DOM.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Is there an example of using multiple html files somewhere? Appreciate if you could set me straight. Thanks!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 03:17:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026514#M40315</guid>
      <dc:creator>Yonghong_R_</dc:creator>
      <dc:date>2015-07-28T03:17:07Z</dc:date>
    </item>
    <item>
      <title>There is not an example of</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026515#M40316</link>
      <description>&lt;P&gt;There is not an example of using multiple html files using both Angular and App Framework. I am assuming this is an issue with the delegation of the function callbacks between Angular and App Framework. I would suggest using our debugger with breakpoints to figure out where your app is failing.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 14:09:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026515#M40316</guid>
      <dc:creator>Brandon_K_Intel</dc:creator>
      <dc:date>2015-08-03T14:09:32Z</dc:date>
    </item>
    <item>
      <title>The web service binding that</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026516#M40317</link>
      <description>&lt;P&gt;The web service binding that you created makes a JS function. Just call it and everything will be repopulated. &amp;nbsp;&lt;/P&gt;

&lt;P&gt;This function is the one you created when you make the binding. &amp;nbsp;So it's name is&lt;EM&gt; intel.xdk.services.your_binding_name&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;If you don't remember it, there are two places to find it:&lt;/P&gt;

&lt;P&gt;js/index_init_services.js&lt;/P&gt;

&lt;P&gt;Look for something like this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;data_support.ready(intel.xdk.services.rottentomatoessearch.bind(null, {}));&lt;/PRE&gt;

&lt;P&gt;So, from the example above, I can see the function name is&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;" style="font-size: 13.008px; line-height: 21.68px;"&gt;intel.xdk.services.rottentomatoessearch&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;And if you call that, the service request will b fired again:&lt;/P&gt;

&lt;PRE class="brush:jscript;" style="font-size: 13.008px; line-height: 21.68px;"&gt;intel.xdk.services.rottentomatoessearch()&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The second place to find it is xdk/services/service-method.js&lt;/P&gt;

&lt;P&gt;It'll be at the end of the file. &amp;nbsp;There is a block that looks like this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;intel.xdk.services.rottentomatoessearch=intel.xdk.services.iodocs_.bindCommon.bind(null,"intel.xdk.services.rottentomatoessearch",intel.xdk.services.iodocs_.rottentomatoes.search,{q:"toy",page_limit:"10",page:"1"});
/*xdk-auto-gen:service-methods:rottentomatoessearch:end*/&lt;/PRE&gt;

&lt;P&gt;And, you can see pretty easily from that example, that the function name is &lt;EM&gt;intel.xdk.service.rottentomatoessearch&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 16:05:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026516#M40317</guid>
      <dc:creator>Chris_P_Intel</dc:creator>
      <dc:date>2015-08-03T16:05:23Z</dc:date>
    </item>
    <item>
      <title>Brandon, Chris,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026517#M40318</link>
      <description>&lt;P&gt;Brandon, Chris,&lt;/P&gt;

&lt;P&gt;Sorry for taking so long to reply, but I &amp;nbsp;want to wrap up the discussion before it goes stale.&lt;/P&gt;

&lt;P&gt;1. Chris, I confirm that calling intel.xdk.services.* works. I didn't know this, and I had moved on by using $http interface to initiate HTTP get/post etc. This way I can control when to call and whether to return data depending on login status.&lt;/P&gt;

&lt;P&gt;2. I played around with dynamically loading html fragments that are in separate files. I couldn't get it to work right and went back to a single HTML file (index.html).&lt;/P&gt;

&lt;P&gt;In conclusion I can move on with what I need, but whether I made right choices remain to be seen.&lt;/P&gt;

&lt;P&gt;Thank you very much for your help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 02:56:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-force-a-listview-repopulate-with-web-service-data-in-XDK/m-p/1026517#M40318</guid>
      <dc:creator>Yonghong_R_</dc:creator>
      <dc:date>2015-08-18T02:56:49Z</dc:date>
    </item>
  </channel>
</rss>

