Meaningless Drivel is fun!*
The moose likes JSF and the fly likes h:panelGrid and colspan Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "h:panelGrid and colspan" Watch "h:panelGrid and colspan" New topic
Author

h:panelGrid and colspan

Anthony Sykes
Ranch Hand

Joined: Aug 25, 2007
Posts: 57
is it possible to set colspan using the h:panelGrid? As an example, say I wanted first two rows to be 2X2 and the last one 1X3.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

No, and it's a real pain. There are some third-party tags that support spanned columns, but not the core tags.

What I end up doing is multiple panelGrids. But then you need to use columnClasses (or equivalent) to keep them lined up properly, since otherwise the column widths will vary for each panelGrid.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
You can also just use plain vanilla HTML.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

The downside to embedding raw HTML in JSF is that JSF views are designed to be abstract. The JSF tags support alternative renderers so that, for example, if you want the same data to display on a desktop web browser, a cellphone web browser, WAP, and something exotic like Display PostScript, the same view definition serves all of them and the framework simply selects the renderer appropriate for the client.

HTML tags aren't that smart, so they'll get passed through as though they were ordinary text, which can be ugly (who wants to see raw HTML in their output?)
<p/>
and won't intelligently
arrange the output. based
on the target platform.

While core JSF doesn't support colspan, the Tomahawk panelGroup does, as does the RichFaces column tag. Just don't try and mix and match them. Although the docs don't say so, they expect to be working within the context of their respective table tags.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:panelGrid and colspan