aspose file tools*
The moose likes JSF and the fly likes Generating Horizontal Menu in JSF using h:dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Generating Horizontal Menu in JSF using h:dataTable" Watch "Generating Horizontal Menu in JSF using h:dataTable" New topic
Author

Generating Horizontal Menu in JSF using h:dataTable

munikrishna macherlla
Greenhorn

Joined: May 15, 2007
Posts: 1
I have to populate the menu dynamically from the database in JSF

am able populate the menus using the following code

<h:dataTable id="menu" value="#{menu.list}" var="item">

<h:column>

<hutputText value="#{item.name}"/>

</h:column>

</h:dataTable>

but which renders like this

Menu1

Menu2

Menu3...



but I want to display these menu in horizontal like



Menu1 Menu2 Menu3

Can you please suggest me on this?

Is it possible in h:dataTable
mano ranjan
Ranch Hand

Joined: Jul 12, 2007
Posts: 102
Hi,
That cannot be done using datatable.If needed i can be done using jstl tag
by using html tags in between jstl tags...

thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

A better approach is to use the JSCookMenu JSF control available with the MyFaces Tomahawk library.


Customer surveys are for companies who didn't pay proper attention to begin with.
chloe wong
Greenhorn

Joined: Aug 02, 2006
Posts: 17
As a matter of fact, it can be done. You have to use dataList instead of dataTable. Assuming you have list in A,B,C..

dataTable will print list in:
A
B
C

where as dataList will print in A B C D ...




I hope this is what you are looking for.
oane derossebrune
Greenhorn

Joined: May 14, 2008
Posts: 1
There is also another way. You can define columnClasses and rowClasses to the datatable. This makes it posible to use CSS and position your elements anywhere you like on the page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generating Horizontal Menu in JSF using h:dataTable