• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

richdata table and rows

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using rich data table . I need to get total no. of rows using Javascript .

If I use (document.getElementById('XXXXXXXX').rows.length .. I am getting only rows of the first page .. Since I am using pagination .. Is there any way/Synax .. sothat I can get all the rows

Appreciate your help.

Thanks,
Rj
 
Saloon Keeper
Posts: 27496
195
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you want, from the sound of it, is to be able to retrieve the total number of rows in the (sub)Model object that backs the dataTable. This problem has the same solution whether you are using rich:dataTable or the core h:dataTable.

Try something like this:


The rowCount attribute of tableModel may not be available if you used a raw collection such as a list or array for the dataTable value. If so, you'll need to explicitly construct a ListDataModel (or ArrayDataModel) to wrap the collection and present it as a backing bean property.

I use a variation of this when I have total rows in a table. I subclass the DataModel class of my choice to add totals as subclass properties.
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic