Java Reference
In-Depth Information
When our project is created, NetBeans will add the required libraries to our project,
PrimeFaces tags will autocomplete in our project's JSF pages.
When selecting PrimeFaces as our JSF component suite, NetBeans creates a sample
page using PrimeFaces components when our project is created. The markup for the
file looks like this:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form>
<p:commandButton value="Hello from PrimeFaces"
onclick="dlg1.show();" type="button"
/>
<p:dialog header="PrimeFaces Dialog" widgetVar="dlg1"
width="500">
For more information visit <a href="http://primefaces.
org">
http://primefaces.org</a>.
</p:dialog>
</h:form>
</h:body>
</html>
Except for a few PrimeFaces-specific components, the page looks like a regular
Facelets page.
Notice the PrimeFaces namespace, xmlns:p=" http://primefaces.prime.com.tr/ui " is
automatically added to the <html> tag. This namespace is necessary in order to use
PrimeFaces components in our pages. By convention, PrimeFaces tags use a prefix of p .
The first PrimeFaces component we see in our page is <p:commandButton> , this
component is similar to the standard JSF command button component, but provides
certain advantages over the standard command button, such as rendering nicely
without us having to manually apply CSS stylesheets.
 
Search WWH ::




Custom Search