• 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

Very newbie question on tables please

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Been trying for a while to figure this out, but getting very confused between different tutorials, sorry.

I am trying to build an event calendar.

I need to show data from a table in my database, in a JSF page, but not show the whole of the table, just the data for that date. I have managed to get a table to show all the events in my events table, but cannot seem to find a way that will let me show just the events for one date ( a date which needs to be able to be changed so that it can show all the events for Sunday in one display, all the events for Monday in a different display elsewhere on the page, and so on). The events shown need to be selectable in some manner. I worked out how to do it putting in a table, or putting in a listbox, but only showing *all* the events, not just for that date.

I only have a couple of weeks left to get this finished and written up and sent in ( its for part of my 3rd year dissertation and I've had an extension already)...so I could really use something that will give me some idea where to start please.

Is there any tutorial or similar out there that will take me very simply through how it should work?

Or is there (hopefully!) some really simple answer I am missing?

Many thanks

Julia
 
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
There are 2 ways.

1. Filter your data retrieval. If you don't fetch the data, the table won't display it.

2. Filter the results. A lot of people think that the only way to present database data is to wrap the entire result set. But you can also create a results subset as a collection object and wrap it, instead. It's a little more overhead that way, but not much, and it's better than doing everything by brute force.

If you're using an ORM to manage database persistence (you used the term table, so I'd presuming that this is database data), a filtered query result set basically does #1 and #2 for you as part of the same operation.
 
Julia Murrell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.. So, if you don't mind, how do I go about doing that please? or where can I go to find out? I'm sorry, I really do not know very much about this. I tried typing filtered query result set into Netbeans help but didnt find anything I understood what to do with
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic