Should be simple but I couldn’t find the answer, I would like to place components horizontally instead of vertically.
What I’m trying to achieve is a rich:toolbar with 2 or more rows. I’ve been trying to do that with a toolbar that has a panelgrid and two panelgroups like this:
<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 the panelgroup layout horizontal (Or should I use something else?)
Thanks!
You probably already know that JSF in webserver ends up as HTML in webbrowser. In HTML, there are several ways to place elements horizontally (eventually with help of CSS):
<span>or any element withdisplay: inline;).<div>or any element withdisplay: block;) and give them all afloat: left;.The JSF
<h:panelGrid>renders a HTML<table>element wherein each child component is taken as a<td>. Thecolumnsattribute represents the max amount of<td>elements in a single<tr>(so that the<h:panelGrid>knows when to put a</tr><tr>in). The JSF<h:panelGroup>renders a<span>element.To achieve way 1 with JSF, you just need to group them in separate
<h:panelGroup>components.Way 2 can be done the same way, but then with
<h:panelGroup layout="block">instead and afloat: left;in their CSS.