• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

First row to be empty inside a datatable

 
Ranch Hand
Posts: 101
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all- i have to display the data from the second row in the datatable and in the first row i should have a check box with select all label. How is it possible? Can i have something like first= -1 in datatable? If i add one dummy VO with spaces as the first object in the list it worke fine but i'm looking for better options..Any clue?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's wrong with an empty VO?

You don't need spaces though. Nulls (object's default value) are perfectly suitable.
 
Saloon Keeper
Posts: 27762
196
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
A variation on that theme is to put the "select all" control in the table header. This may be preferable if you have a pageable table and don't want that option to scroll out of sight.

Be careful when using abbreviations - as an (alleged) native English speaker, it took me a few minutes to infer that "VO" meant Value Object. And we have a lot of members who aren't normally thinking in English.

I do not recommend using NULL. NULL isn't data - it's the absence of data. It has a very bad habit of getting garbled when moved around - I've seen more than one database end up with the word "null" in a text field after someone had edited it where the original value was a null object. Plus in Java, primitives such as int and char cannot even have a null value. JSF tends to be very forgiving of null, but not all frameworks are so accomodating, and even in JSF there are pitfalls.

Treat null with the same respect as NaN - they're both very useful and very dangerous. You don't have to pad out an empty string with spaces - a simple "" will do, especially when rendering HTML, which tends to treat spaces rather casually anyway.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Uh, for that you have validators.
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic