5 Replies Latest reply: Apr 13, 2012 3:39 PM by 836337 RSS

    Using email output mode with af:table

    836337
      Hi everyone,

      I am currently experiencing an issue with the email output mode. We have a page with an af:table that allows email output mode. When in thise mode, the table only shows 1-15 results.

      How can we allow the table to show all it's content?

      Thank you.
        • 1. Re: Using email output mode with af:table
          Dimitar Dimitrov
          The number of table rows displayed in "email" mode is determined by the af:table's "rows" attribute. By default this attribute is bound to the data iterator's range size. You can modify the "rows" attribute in order to return an arbitrary large number when the page is displayed in "email" mode, thus instructing the table to render all the rows, for example:
          <af:table value="#{bindings.DepartmentsView1.collectionModel}"
                    rows="#{adfFacesContext.outputMode=='email' ? 1000000 : bindings.DepartmentsView1.rangeSize}"
                    ...
          Dimitar
          • 2. Re: Using email output mode with af:table
            896726
            I am thinking instead of 1000000 , it would be better to put -1... and also i think that's rangeSize rather than rows ... i mean:

            <af:table value="#{bindings.DepartmentsView1.collectionModel}"
            rangeSize="#{adfFacesContext.outputMode=='email' ? -1: bindings.DepartmentsView1.rangeSize}"

            since -1 will load all rows.
            • 3. Re: Using email output mode with af:table
              Dimitar Dimitrov
              I am thinking instead of 1000000 , it would be better to put -1... and also i think that's rangeSize rather than rows
              No, it would not be better to put -1, because -1 is not accepted by the "rows" attribute and then the "rows" attribute would default to 25 :)
              Also the <af:table> tag does not have a "rangeSize" attribute.

              Dimitar

              Edited by: Dimitar Dimitrov on Apr 13, 2012 11:26 PM
              • 4. Re: Using email output mode with af:table
                896726
                my bad, i mixed pagedef attribute for af:table ....

                for pagedef rangeSize = -1 will load all rows ... i take back :D
                • 5. Re: Using email output mode with af:table
                  836337
                  I tried the rows with -1 and it didn't worked (to confirm).

                  I ended up hardcoding a rows value that is equals to my fetchSize and it solved the problem. The table has a lot of lines but not THAT much thus I can manage to hardcode it.

                  The fetchSize was needed to remove the scrollbar. The rows was needed purely for the "email" output. I'm having trouble using a range or size attribute; the table is inside a for:each that is inside an iterator so all my objects properties seems to be lost.

                  Well thank to all your ideas, it works now.

                  Thanks !