0 Replies Latest reply: Oct 7, 2012 12:28 AM by 966634 RSS

    JSF2: Creating Custom Component [OutputObject]

    966634
      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