This discussion is archived
0 Replies Latest reply: Oct 6, 2012 10:28 PM by 966634 RSS

JSF2: Creating Custom Component [OutputObject]

966634 Newbie
Currently Being Moderated
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>
<h1>User Bean</h1>
<cc:outputObject value="#{mybean.user}" />
<h1>Address Bean</h1>
<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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points