JSF column Tag

This section tells you about the JSF html column tag which is used for creating columns of a table. This tag creates a data column inside a data table.

Ads

Tutorials   
JSF Tutorials: Easy steps to learn JSF Java Server Faces (JSF) Tutorials What is JSF Mojarra? JSF Life Cycle JSF Examples JSF Tutorial For Beginners Roseindia JSF Tutorial JSF core Tag Reference JSF internationalization example Tomahawk selectOneCountry tag RCFaces About Hibernate, Spring and JSF Integration Tutorial Creating Login Page In JSF using NetBeans JSF Hello World Declaring the Bean class in the faces-config.xml file Creating a Web Application with the JSF Framework Binding the Form Elements With the Bean Properties Adding Navigation in JSF Application Binding Component Instance to a Bean Property Tomahawk validateEqual tag Tomahawk validateEmail tag Tomahawk validateCreditCard tag Tomahawk selectOneListbox tag Tomahawk selectManyListbox tag Tomahawk selectManyCheckbox tag Tomahawk selectBooleanCheckbox tag Tomahawk saveState tag Tomahawk popup tag Tomahawk inputCalendar tag Tomahawk htmlTag tag Tomahawk graphicImage tag Tomahawk documentHead tag Tomahawk documentBody tag Tomahawk document tag Tomahawk column tag DataBase Connectivity with MySql in Visual Web JSF Application Using Net Beans IDE Retrieve Image in JSF From MySQL Table Using NetBeans IDE JSF Training Java Sever Faces 1.2 - JSF 1.2 Display Data from Database in JSF Application Business Objects of Business Logic tier Setup MySQL Database Working with Database through JDBC Working with JavaScript & CSS Referencing a Localized Message Referencing Resource Bundle from a Page Binding Component Value to an Implicit Object Phase Listener Value Change Event Listener Action Event Listener
Ads

JSF column Tag

    

This section tells you about the JSF html column tag which is used for creating columns of a table. This tag creates a data column inside a data table. By this table you can specify number of column and fix these with some specific values. You can specify the value for specific column by using data array. JSF data table creates multiple rows up to the length of array or number of elements associated with the data table.

This section provides you a complete code of a program in which the column tags are used inside the data table. This program will help you for the procedure of using column tag for creating columns in a table.

Code Description:

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
   <head><title>jsf h:column example</title></head>

   <body>
  <h:dataTable border="1">
  <f:facet name="header">
  <h:outputText value="This is header."/>
  </f:facet>
  <h:column>
  <f:facet name="header">
   <h:outputText value="Student"/>
  </f:facet>
  </h:column>
  <h:column>
  <f:facet name="header">
   <h:outputText value="Marks" />
  </f:facet>
  </h:column>
  <h:column>
  <f:facet name="header">
   <h:outputText value="Percent" />
  </f:facet>
  </h:column>
  <f:facet name="footer">
   <h:outputText value="This is footer."/>
  </f:facet>
  </h:dataTable>
   </body>
</html>
</f:view>

Rendered Output:

HTML Source Code:

<html>
   <head><title>jsf h:column example</title></head>

 <body>
 <table border="1">
 <thead>
  <tr><th colspan="3" scope="colgroup">This is header.</th></tr>
    <tr>
       <th scope="col">Student</th>
          <th scope="col">Marks</th>
            <th scope="col">Percent</th>
           </tr>
        </thead>
        <tfoot>
       <tr><td colspan="3">This is footer.</td></tr>
      </tfoot>
     <tbody>
    </tbody>
   </table>
  </body>
</html>

JSF column tag has some attribute for different purposes. These attributes are explained below:

  • rendered: This is an attribute of the column tag that is optional. This attribute can hold String typed value. This attribute value indicates that the component should be rendered during the rendering period.
  • binding: This attribute is also optional and take a String typed value. Specified value is linked with the backing bean through the attribute of the tag.
  • id: This attribute of the column tag is specified only for identification of the specific tag.

Advertisements

Ads
Share on Google+Share on Google+

JSF column Tag

Posted on: May 29, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: JSF column Tag   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads