Topic
No replies
adevedo
adevedo
1 Post
ACCEPTED ANSWER

Pinned topic JSF2: Creating Custom Component [OutputObject]

‏2012-10-07T05:06:35Z |
In this article, you will see just how easy it is to create new components that are fully functional and integrated into your web applications by creating a new component that takes a simple - with primative attributes only - java bean object as a value and his output will be the bean details printed in HTML table

e.g.

JSF code:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cc="http://myapplication.com/com">
<h:head></h:head>
<h:body>

User Bean

<cc:outputObject value="#{mybean.user}" />

Address Bean

<cc:outputObject value="#{mybean.address}" />
</h:body>
</html>

Will produce the following:

http://adevedo.com/sites/default/files/articles_images/05102012/output.png

The article...

http://www.adevedo.com/content/jsf2-creating-custom-component-outputobject