This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

creating a product list in JSF

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I am making a web-shopesque application in JSF. I was getting along quite good but now I've hit a wall and don't know how to proceed.

What I want is this: I want to show a list of products on the page. For this I have created a CatalogBean which has a List of ProductBeans (ProductBeans having been loaded from the database and containing all the neccessary info about the product - name, link to the gif, price, etc.)

The page should render the list of products in rows separated by a horizontal line. Every product is represented like this:

PICTURE ................. Description
.............................. Price
.............................. Command Link (add to Cart)
--------------------------------------------------------
PICTURE

etc.

The problem is I don't even know where to start. I know how to use a DataTable but only to show the info in rows, like this:

PICTURE Description Price Add to Cart
---------------------------------------
PICTURE etc.

But that's not what I want.

Can somebody please give me a few pointers how to get the former rendition? I would be extremely grateful.

Thanks in advance and cheers!
[ October 27, 2005: Message edited by: Baba Bizlowsky ]
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could create a custom dataTable component or custom UI component, that's one solution.

You could also fudge it using a JSTL forEach loop
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this post is a little old, but is there any reason not to do the following?

For your Datatable, declare only one column: a PanelGrid where you lay out your product description as you want to.



You still have only one row per product, so datatable works. The panelGrid lets you do formatting as you wish.
[ November 13, 2005: Message edited by: Stefan Evans ]
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic