• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 26025
186
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.
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic