Search code examples
jsf-2panelgrid

How to put multiple components in a single cell of h:panelGrid


I would like to create a <h:panelGrid> with one column. However in one row I would like to fit two components together in one cell.

E.g.

<h:panelGrid columns="1">
     <h:outputText value="ROW 1 A"/>
     <h:outputText value="ROW 1 B"/>

     <h:outputText value="ROW 2"/>
</h:panelGrid>

Should end up in two rows

ROW 1 A ROW 1 B
ROW 2

However, it currently ends up as

ROW 1 A
ROW 1 B
ROW 2

How to put multiple components in a single cell of <h:panelGrid>?


Solution

  • how about wrapping with single <h:panelGroup>

    <h:panelGroup>
        <h:outputText value="ROW1 A"/>
        <h:outputText value="ROW 1 B"/>
    </h:panelGroup>