Horizontal placement of components in JSF

It should be simple, but I could not find the answer, I would like to place the components horizontally, not vertically.

What I'm trying to achieve is a rich toolbar with two or more lines. I tried to do this using a toolbar with a panel and two panel groups, such as:

<rich:toolbar...>
  <f:panelgrid columns="1"...>
    <f:panelgroup id="row1" .../>  <-- Should be horizontal placement
    <f:panelgroup id="row2" .../>  <-- Should be horizontal placement
  <f:panelgrid/>
<rich:toolbar/>

So, how do I make a horizontal panel panelgroup (or do I need to use something else?)

Thank!

+5
source share
1 answer

You probably already know that the JSF in the web server ends up as HTML in the webbrowser. There are several ways to place elements horizontally in HTML (ultimately using CSS):

  • (, <span> display: inline;).
  • (, <div> display: block;) float: left;.

JSF <h:panelGrid> HTML <table>, <td>. columns <td> <tr> ( <h:panelGrid> , </tr><tr>). JSF <h:panelGroup> <span>.

1 JSF, <h:panelGroup>.

<rich:toolbar ...>
    <h:panelgroup id="row1" ... />
    <h:panelgroup id="row2" ... />
</rich:toolbar>

2 , <h:panelGroup layout="block"> float: left; CSS.

+4

All Articles