Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

box layout using HtmlPanelGroup

 
Ranch Hand
Posts: 633
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Bartender
Posts: 20984
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jignesh Patel
Ranch Hand
Posts: 633
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Bartender
Posts: 20984
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 633
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 633
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Are we home yet? Wait, did we forget the tiny ad?
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!