Java Reference
In-Depth Information
url=
"http://www.primefaces.org/showcase-labs/ui/
home.jsf"
/>
<p:menuitem value="Documentation"
url="http://www.primefaces.org/
documentation.html"
/>
<p:menuitem value="Forum"
url="http://forum.primefaces.org/" />
<p:menuitem value="Themes"
url="http://www.primefaces.org/themes.
html" />
</p:submenu>
</p:menu>
</p:layoutUnit>
<p:layoutUnit position="center">
Welcome to PrimeFaces
</p:layoutUnit>
</p:layout>
</h:body>
</f:view>
</html>
To use PrimeFaces components in our JSF pages, we need to use the
xmlns:p="http://primefaces.org/ui" namespace. NetBeans automatically
adds this namespace to the generated page.
Notice that the rendered page is divided into sections (a header, footer, left hand-
side menu, and the main content area of the application). Normally, we would have
to use HTML <div> tags and CSS to create a layout like this. PrimeFaces, however,
includes the <p:layout> component that takes care of all the difficult tasks for us.
Inside <p:layout> , we need to have some nested <p:layoutUnit> components to
create specific sections for the page. The <p:layoutUnit> element has a position
attribute that we can use to specify what section the layout unit corresponds to:
• A value of north will result in the layout unit being rendered at the top
of the page. The width of the section will automatically cover all available
horizontal space in the browser window. This value is used to generate the
Header section in the NetBeans-generated markup.
 
Search WWH ::




Custom Search