• Post Reply Bookmark Topic Watch Topic
  • New Topic

creating a product list in JSF

 
Baba Bizlowsky
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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 ]
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • 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
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!