<?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: getItems() method for table returns up to 20 rows in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761928#M221200</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Could you show the debug calls with the data?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 09:51:00 GMT</pubDate>
    <dc:creator>jorge_cabanas</dc:creator>
    <dc:date>2019-01-08T09:51:00Z</dc:date>
    <item>
      <title>getItems() method for table returns up to 20 rows</title>
      <link>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaq-p/761926</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;I have a report table that is populated in three different ways, depending on selection filters. At the end of the called report I use the "updateFinished" event to loop through the table entries, paint them zebra style and paint last summary line pink.&lt;/P&gt;
  &lt;P&gt;SAPUI5 Application version is 1.44.12&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;                        this.oStsTable = this.getView().byId("statusReportTable");

                        this.oStsTable.attachEventOnce("updateFinished", function(oEv) {
                            var aItems = oEv.getSource().getItems();
                            if (aItems &amp;amp;&amp;amp; aItems.length &amp;gt; 0) {
                                for (var i = 0; i &amp;lt; aItems.length; i++) {
                                    if (i === aItems.length - 1) {
                                        aItems[i].addStyleClass("pinkBackground");
                                    } else { 
                                        var even = i % 2;
                                        if (even !== 0 &amp;amp;&amp;amp; i &amp;lt; aItems.length) {
                                            aItems[i].addStyleClass("cyanBackground");  
                                        }                       
                                    }
                                }
                            }
                        });                         

                        this.byId("statusReportTable").getBinding("items").filter(oTableSearchState);&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;With the data available, I get back 3 datasets. 7 for case 1, 7 for case 2 and 23 for case 3. With the first two cases everything is OK. Problem is with case 3 (23 records). Debugging on the back-end, I see 23. When table appears, I see again 23. But the getItems() method within "updateFinished" event sees only 20 (!). As result of it (yes, guessed right), line 20 goes pink and the remaining lines without color as loop exits.&lt;/P&gt;
  &lt;P&gt;Rings any bells?&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/259633-correct7.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/259634-incorrect23.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:32:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaq-p/761926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-01-07T16:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: getItems() method for table returns up to 20 rows</title>
      <link>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761927#M221199</link>
      <description>&lt;P&gt;Hi Gregory,&lt;/P&gt;&lt;P&gt;I suppose the problem you encountered is caused by the way UI5 list handle aggregations. To save memory the list only generates 20 items and fetches and generates another 20 once you scroll down (https://sapui5.hana.ondemand.com/#/api/sap.m.ListBase/methods/setGrowingThreshold). &lt;/P&gt;&lt;P&gt;Can you check if the problem is still there if you change the growingthreshold?&lt;/P&gt;&lt;P&gt;PS: I would recommend to implement such a feature with CSS&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 09:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761927#M221199</guid>
      <dc:creator>mariusobert</dc:creator>
      <dc:date>2019-01-08T09:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: getItems() method for table returns up to 20 rows</title>
      <link>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761928#M221200</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Could you show the debug calls with the data?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 09:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761928#M221200</guid>
      <dc:creator>jorge_cabanas</dc:creator>
      <dc:date>2019-01-08T09:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: getItems() method for table returns up to 20 rows</title>
      <link>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761929#M221201</link>
      <description>&lt;P&gt;This was exactly the case, worked like a charm, thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 11:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/getitems-method-for-table-returns-up-to-20-rows/qaa-p/761929#M221201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-01-08T11:20:57Z</dc:date>
    </item>
  </channel>
</rss>

