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

Showing Sequence No with datatable

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i m using h : datatable and i that 1 of the colums i want to show sequence No like
1
2
3
4
5
until the datatable loop.
how can i print that between h:column

i also tried using jstl tags but it is not working
any suggestion on this , pl help

Thank u,
Nishita
[ April 03, 2006: Message edited by: Nishita Jain ]
 
Nishita Jain
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
somebody pls help me. i m stuck because of this.
Thank you.
[ April 07, 2006: Message edited by: Nishita Jain ]
 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I do is put the number inside the bean that is displayed in the row.
 
Nishita Jain
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya, that can be done but is it a good idea to put it in bean ,generate getter setter?
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm also stuck on this bugger or a problem. I'm using huge numbers of objects and having to display up to 1000 at a time. I've been for'ing through lists and generating arrays of the object properties with a element that holds a line number, then adding those arrays to another list to pass to the datatable, but this I realise is incredibly inefficient and slow. I'd really like to know if there's a better solution too!
Isn't there something that generates row numbers dynamically?
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomahawk's version of the dataTable has a "rowIndexVar" attribute that you can use to do this.
 
Jamie Williams
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot! That will really help!

For those not using Tomahawk - here's a simple solution.

Use a simple get method in a bean that keeps count of the row number, every time you call the get method, increment it then return. When you want to 'reset' the number (say, for another table on the same page) set your counter back to zero in an empty method that checks if the table is rendered or not eg. isMyDataTableRendered()
 
Nishita Jain
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,,
thanks for the solution . i think this number solution is already put by Gerardo. but what i want to ask is is that a good way to put your no in bean.. i think we can consider this as bug . what u say?

Nishita
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic