Page components

Page Components are used to mark a JSF page with the major HTML structuring elements corresponding roughly to the HTML HTML, BODY and FORM tags.
All JSF pages (that are not fragments) normally include an <f:view> tag (corresponding to the HTML HTML tag which in turn contains an <hx:scriptCollector> tag. The HTML HTML, HEAD and BODY tags are also required in a JSF page. Thus a normal JSF page consists of the following tags:
<HTML>
	<HEAD>
	</HEAD>
	<f:view>
		<BODY>
			<hx:scriptCollector id="scriptCollector1">
				<h:form styleClass="form" id="form1">
				</h:form>
			<hx:scriptCollector>
		</BODY>
	</f:view>
</HTML>

In addition, a pair of tags <f:subview> and <hx:viewFragment> can be used to mark out sub-namespaces within a page when including JSP or JSF fragments.

The available page tags are:

Components that are initially hidden on the palette are denoted by an asterisk (*) next to their name in the tables.

Table 1. Page components
Component Tag Name Description
*Form <h:form> The equivalent of an HTML form tag. Creates a main container for other components. Added automatically when needed.
Script collector <hx:scriptCollector> Essentially the equivalent of an HTML body, the tag structures the JavaScriptâ„¢ emitted into a page so it can be used in a portal or AJAX environment.
SubView <f:subview> Establishes a sub-page within a view. Primarily used to introduce a new naming context (for example, around an included fragment) to ensure that component IDs have unique names.
View <f:view> The outermost JSF container object. All other JSF tags must be inside a view. It is the equivalent of a page.
View fragment <hx:viewFragment> An improved version of f:subview that correctly orders JSF and HTML tags.
Related concepts
Asynchronous JavaScript and XML (AJAX) Components
JavaServer Faces (JSF) overview
JSF Widget Library (JWL)
Developing Web applications using JavaServer Faces (JSF)

Feedback