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 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.
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.