This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Loop over Value Objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Loop over Value Objects?" Watch "Loop over Value Objects?" New topic
Author

Loop over Value Objects?

Ronald Johnson
Greenhorn

Joined: Jan 15, 2007
Posts: 18
I want to create an output that is similar to a search result, e.g. the search results from google:

for each entry found in the list the output would be something like:

Title
description
date added, additional information

but with even more information, and sometimes an image shown or additional information shown depending on some data in the value object.

Is this possible in JSF? How?

I would appreciate any pointers in the right direction, since I cannot find anything on this topic...

cheers,

RJ
John Bartlett
Ranch Hand

Joined: Jan 25, 2006
Posts: 116
Hi,

Why not use a dataTable?

John
Ronald Johnson
Greenhorn

Joined: Jan 15, 2007
Posts: 18
as far as i can see, i cannot control the output like that.
e.g. an entry would be

(1) JavaServer Faces Technology
(2) The Java Enterprise Community on java.net The Java Enterprise Community is a gathering place for developers ...
(3) java.sun.com/javaee/javaserverfaces/ - 30k - Cached - Similar pages - Note this

where (1) is a larger headerline, (2) is a description with smaller font size
(3) is a row that cointans different information, that will have different styles.

Is that possible to create with a datatable?

RJ
John Bartlett
Ranch Hand

Joined: Jan 25, 2006
Posts: 116
Hi,

you can have different styles for different columns, all you have to use is a tomahawk column (t:column) as they have a styleClass property.

You can also nest dataTables

So couldnt you have something like,

e.g.


this way you could nest dataTables and produce the nice output...?

---- Method 2 -----

You could use a dataTable to show rows of search results and a nested panelGrid to display the contents of that searchResult. That would probably be a slightly better idea. You would not need a Information object then, you could jsut store all the data on the searhcResult Object?

This would result in something like this,



I have never tried a nested panel grid but i believe it would work, and would be extremely easy to produce.

John
[ January 30, 2007: Message edited by: John Bartlett ]
Ronald Johnson
Greenhorn

Joined: Jan 15, 2007
Posts: 18
cheers for the reply, the nested elements seems to be a way to get what I want. It will be interesting to see how it goes when i receive the first batch of html docs from the designer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loop over Value Objects?
 
Similar Threads
Error compiling JSP
Struts Life Cycle
How to set OracleCallableStatement.Regist… to use byte instead of char?
jsp page appears in xml tree format. how can i fix this?
save the output of JSP into a inputstream