Name

<h:form>

Synopsis

This action represents an instance of the component type registered with the type ID javax.faces.HtmlForm (by default, an instance of the javax.faces.component.html.HtmlForm class), combined with a renderer registered with the renderer type ID javax.faces.Form.

The component is rendered as an HTML <form> element with an action attribute set to a URL that identifies the view containing the form and a method attribute set to post. When the form is submitted, only components that are children of the submitted form are processed.

Syntax

<h:form [id="id"] [binding="componentBinding"] [rendered="true|false"]
  <!-- HTML attributes -->
  [accept="contentTypes"] [acceptcharset="charEncodings"] [enctype="encType"]
  [dir="ltr|rtl"] [lang="lang"]
  [onclick="code"] [ondblclick="code"] 
  [onkeydown="code"] [onkeypress="code"] [onkeyup="code"]
  [onmousedown="code"] [onmousemove="code"] [onmouseout="code"]
  [onmouseover="code"] [onmouseup="code"] [onreset="code"] [onsubmit="code"]
  [style="style"] [styleClass="styleClass"] [target="target"] [title="title"] 
>
    JSF component action elements
</h:form>

Attributes

Attribute name

Java type

EL expression type

Description

binding
String

VB

Must be a value binding expression for a property the component is bound to.

id
String

None

The component ID.

rendered
boolean

Any

If set to false, the component isn’t rendered and doesn’t participate in any request processing.

Example

                     <h:form> <h:panelGrid columns="2"> <h:outputText value="First ...

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.