Java Reference
In-Depth Information
<h:panelGrid columns="1">
<ezcomp:address namedBean="#{addressBean}"
addrType="Home"/>
<h:commandButton value="Submit" action="confirmation"
style="display: block; margin: 0
auto;"/>
</h:panelGrid>
</h:form>
</h:body>
</html>
By convention, the namespace for our custom components will always be
xmlns:ezcomp="http://xmlns.jcp.org/jsf/composite/ezcomp" (this is why it
is important not to override the default folder where our component will be placed,
as doing so breaks this convention). NetBeans provides code completion for our
custom composite components, just like it does for standard components.
In our application, we created a simple named bean called addressBean . It is a
simple managed bean with a few properties and corresponding getters and setters;
therefore, it is not shown (it is part of this chapter's code download). We use this
bean as the value of the namedBean attribute of our component. We also used an
address type of Home , and this value will be rendered as a header for our address
input component.
After deploying and running our application, we can see our component in action, as
shown in the following screenshot:
As we can see, creating JSF 2 composite components with NetBeans is a breeze.
 
Search WWH ::




Custom Search