wood burning stoves 2.0*
The moose likes JSF and the fly likes box layout using HtmlPanelGroup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "box layout using HtmlPanelGroup" Watch "box layout using HtmlPanelGroup" New topic
Author

box layout using HtmlPanelGroup

Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

I have requirement to display multiple panels/panelgrid on the screen. I have used HtmlPanelGroup to accomodate everything. It works but then panelgroup generates view symmetrically, while it has to display like a box layout(i.e. the between each panel should have any gaps, it should be displayed one by one without any gap). Any idea how to resolve this. I am attaching my code as follows:

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

It's a little hard to follow that in code, but there are options available - I just need to explain them in tag terms, where I'm more comfortable.

The panelGrid tag renders as an HTML Table. Like its underlying HTML, there are attributes you can set for cell padding and spacing.

Panels themselves render as HTML divs, I think. At any rate, the style and styleClass attriibutes can be used in conjunction with the standard CSS margin and padding features.


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

Joined: Nov 03, 2001
Posts: 626

Tim Holloway wrote:It's a little hard to follow that in code, but there are options available - I just need to explain them in tag terms, where I'm more comfortable.

The panelGrid tag renders as an HTML Table. Like its underlying HTML, there are attributes you can set for cell padding and spacing.

Panels themselves render as HTML divs, I think. At any rate, the style and styleClass attriibutes can be used in conjunction with the standard CSS margin and padding features.


Tim I have statred putting in xhtml page. This time I have tried to use datagrid(I am flexible on using either datagrid or panelgrid). The code is as follows:

As you can see I have to display subcategories for given category. I do have method called category.getSubCategories(), which returns set of subcategories.
But how to display them through use of datagrid and panelgrid.

So my problem is, I have collection of categories which in turn also contains collection of subcategories. And I have to display all together.

When I tried to display through code in my first post, it works but then I have all the grid of equal size, it takes up the max grid size irrespective of size of other grids and I don't want that.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

PanelGrid is designed for straight table displays (HTML table style). DataGrid is a PanelGrid-style display coupled with a data iterator.

In both cases, you should be able to control the overall size of the table display using the "style=" and "styleClass=" attributes on the grid tag. You can also define cell characteristics using the rowClasses and/or columnClasses attributes.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

So are you saying by using stylesheet I can change the behaviour of table cell to display like a grids with different size?

Is there any other component in rich faces family which provides grid layout?
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Tim,

I am trying to use projection as style sheet is not going to solve my problem. The code is as follows:


But I am getting error .
I do have jboss-el.jar in my lib folder then why this problem is coming. I am using tomcat 6 and seam2.1.2.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: box layout using HtmlPanelGroup
 
Similar Threads
Dynamic Table using PanelGrid/PanelGroup
h:panelGrid with Attribute value
how to bind value attribute inside another component binding attribute
How to display only selected amount of data from database in two dropdown lists?
Problem using tomahawks selectmanycheckbox-component and spreadlayout