O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing the PanelGrid component

The panelGrid component is an extension to a standard JSF <h:panelGrid> component supporting rowspan and colspan features along with theming support.

Let us see how to create a PanelGrid along with header and footer:

<p:panelGrid columns="2">
  <f:facet name="header">
    <h:outputLabel value="User Login Form" />
  </f:facet>
  <h:outputLabel value="UserName:" />
  <p:inputText value="#{userController.userName}"/>
  
  <h:outputLabel value="Password:" />
  <p:password value="#{userController.password}"/>
  
  <f:facet name="footer">
    <p:commandButton value="Login"/>
    <p:commandButton type="reset" value="Rest"/>
  </f:facet>
</p:panelGrid>

The preceding code renders a panelGrid component as follows:

By default PrimeFaces panelGrid generates ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required