<?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 Widget - doReload() - how to get feedback on completion/success/failure? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Widget-doReload-how-to-get-feedback-on-completion-success/m-p/1625698#M11351</link>
    <description>&lt;P&gt;I have created a widget to reload data in my app.&lt;/P&gt;&lt;P&gt;It is very simple, based on the sample code snippet for a reload button.&lt;/P&gt;&lt;P&gt;I have had to create e security rule that gives read and update authority to users on the app and app objects where this widget is to be used, and I have had to give these users read authority to the data connection that is used in the app.&lt;BR /&gt;This works fine in both desktop and server.&lt;BR /&gt;I use expression =ReloadTime() in the title of the widget to see when it changes.&lt;/P&gt;&lt;P&gt;Unfortunately, the sample code snippet from the widget editor does not give any feedback about success or failure of the data load.&lt;/P&gt;&lt;P&gt;After some fidling, I managed to let it show an animated gif with an hourglass.&lt;/P&gt;&lt;P&gt;This is what the widget code looks like (I replaced the anigif with a sync lui icon in the span):&lt;/P&gt;&lt;P&gt;&amp;lt;lui-button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ng-click="app.doReload();ShowIcon=1;"&amp;nbsp; // this is the code executed on click&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ng-init="ShowIcon=0"&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// this is the initialisation of the variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Reload App&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this is the caption on the button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;span class="lui-icon lui-icon--sync"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // followed by an icon that is initially hidden&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aria-hidden="true"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ng-show="ShowIcon"&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this controls the visibility of the icon based on the variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;lt;/lui-button&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The button does not get redrawn when the data load is complete, so the data changes (or it doesn't if nothing has changed) but the hourglass gif does not disappear.&lt;/P&gt;&lt;P&gt;I have tried to do sth like &lt;EM&gt;app.doReload().then(ShowIcon=0)&lt;/EM&gt; or&amp;nbsp;&amp;nbsp;&lt;EM&gt;app.doReload().then( function() {ShowIcon=0})&lt;/EM&gt; or &lt;EM&gt;app.doReload().then((result) ShowIcon=0)&lt;/EM&gt;&amp;nbsp;and many variations but that just doesn't work at all. the reload no longer gets executed and obviously also no feedback.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way that I can have feedback (callback? then? ...?) on the doReload in a widget?&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:03:05 GMT</pubDate>
    <dc:creator>bediehau</dc:creator>
    <dc:date>2024-11-16T20:03:05Z</dc:date>
    <item>
      <title>Widget - doReload() - how to get feedback on completion/success/failure?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Widget-doReload-how-to-get-feedback-on-completion-success/m-p/1625698#M11351</link>
      <description>&lt;P&gt;I have created a widget to reload data in my app.&lt;/P&gt;&lt;P&gt;It is very simple, based on the sample code snippet for a reload button.&lt;/P&gt;&lt;P&gt;I have had to create e security rule that gives read and update authority to users on the app and app objects where this widget is to be used, and I have had to give these users read authority to the data connection that is used in the app.&lt;BR /&gt;This works fine in both desktop and server.&lt;BR /&gt;I use expression =ReloadTime() in the title of the widget to see when it changes.&lt;/P&gt;&lt;P&gt;Unfortunately, the sample code snippet from the widget editor does not give any feedback about success or failure of the data load.&lt;/P&gt;&lt;P&gt;After some fidling, I managed to let it show an animated gif with an hourglass.&lt;/P&gt;&lt;P&gt;This is what the widget code looks like (I replaced the anigif with a sync lui icon in the span):&lt;/P&gt;&lt;P&gt;&amp;lt;lui-button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ng-click="app.doReload();ShowIcon=1;"&amp;nbsp; // this is the code executed on click&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ng-init="ShowIcon=0"&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// this is the initialisation of the variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Reload App&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this is the caption on the button&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;span class="lui-icon lui-icon--sync"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // followed by an icon that is initially hidden&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; aria-hidden="true"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ng-show="ShowIcon"&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // this controls the visibility of the icon based on the variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;lt;/lui-button&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The button does not get redrawn when the data load is complete, so the data changes (or it doesn't if nothing has changed) but the hourglass gif does not disappear.&lt;/P&gt;&lt;P&gt;I have tried to do sth like &lt;EM&gt;app.doReload().then(ShowIcon=0)&lt;/EM&gt; or&amp;nbsp;&amp;nbsp;&lt;EM&gt;app.doReload().then( function() {ShowIcon=0})&lt;/EM&gt; or &lt;EM&gt;app.doReload().then((result) ShowIcon=0)&lt;/EM&gt;&amp;nbsp;and many variations but that just doesn't work at all. the reload no longer gets executed and obviously also no feedback.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way that I can have feedback (callback? then? ...?) on the doReload in a widget?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Widget-doReload-how-to-get-feedback-on-completion-success/m-p/1625698#M11351</guid>
      <dc:creator>bediehau</dc:creator>
      <dc:date>2024-11-16T20:03:05Z</dc:date>
    </item>
  </channel>
</rss>

