Show TOC Start of Content Area

Background documentation Standard JSF Tags  Locate the document in its SAP Library structure

There are 43 standard JSF tags, which can be divided into two basic types:

      Equivalents to HTML tags - Represent the most essential HTML tags, such as <table>, <form>, input elements, submit and reset buttons, links, and so on.

JSF tags have a limited set of attributes corresponding to some of the HTML tag attributes. We recommend that the you use stylesheets instead of hardcoded formatting.

JSF provides an additional tag for dynamic data, which is not available in pure HTML, namely the dataTable tag. It actually constructs a standard <table>component where the row number is not fixed. This is useful, for example, if you want to display information about employees taken from a database, and you cannot know the number of employees in advance.

·        Core JSF tags - Provide core UI actions, such as validation, conversion, displaying error messages and handling events.

A typical Web page with JSF tags looks like this:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

 

<f:view>           

  <h:form>

 

  </h:form>

</f:view>

The directive <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>specifies that HTML-equivalent tags will have the "h" prefix in the source code - for example, <h:form> or <h:panelGrid>. You can specify any prefix instead of "h" and use it in your source code. In this case, your tags will look like this: <myprefix:form>, <myprefix:commandButton>, and so on.

The directive <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>describes the prefix for code tags. In this case, it is "f" - for example, <f:view> or <f:facet>. You can also use any other prefix instead of "f".

 

 

 

End of Content Area