This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to use datatable with no records in a list  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have a datatable which displays 4 columns. Each column has a header. I use arraylist with datatable.

Here is what i want to do. When arraylist has values then datable works fine but when arraylist is null or has size 0 I still want to display column headers and a single row dispalying message "No record found".

I did following for this.

First I added this


So this will not renderer my datatable at all if list is null.

Now I add another datatable tag with


This data table will only show headers and a 'no rec found' message. But this will show message in the first column only. I want to display it as one row without any columns.(In HTML terms I want to assign colSpan=4 to display it as a row)

If any one can suggest any thing.

Thanks in advance.
[ September 07, 2005: Message edited by: Gregg Bolinger ]
 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited your post to use Code Tags and I also removed the smilies. In the future try to use code tags when posting code and especially when posting JSP tags and such disable smilies in the post. There is a checkbox towards the bottom of the new post form.
 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks i will keep that in mind.
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Customize the data table renderer.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Priti Shah:

Here is what i want to do. When arraylist has values then datable works fine but when arraylist is null or has size 0 I still want to display column headers and a single row dispalying message "No record found"...



Couldn't you use PanelGrid with PanelGroup in the #{empty myBean.list} case? See PanelGrid example: http://www.exadel.com/tutorial/jsf/jsftags-guide.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!