Name

<h:commandButton>

Synopsis

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

The component is rendered as an HTML <input> element with the type attribute set to submit, reset, or image (depending on the value of this action element’s type and image attribute values), the name attribute set to the component’s client ID, and the value attribute set to the component’s value. Clicking the rendered button submits the form it belongs to and triggers a javax.faces.event.ActionEvent.

Syntax

<h:commandButton [id="id"] [binding="componentBinding"] [rendered="true|false"] 
  [value="value"] [type="submit|reset" | image="imageURL"]
  [action="actionMethodBinding"] [actionListener="actionListenerBinding"]
  [immediate="true|false"]
  <!-- HTML attributes -->
  [accesskey="accessKey"] [alt="altText"] [dir="ltr|rtl"] [disabled="true|false"]
  [lang="lang"] 
  [onblur="code"] [onchange="code"] [onclick="code"] [ondblclick="code"]
  [onfocus="code"] [onkeydown="code"] [onkeypress="code"] [onkeyup="code"]
  [onmousedown="code"] [onmousemove="code"] [onmouseout="code"]
  [onmouseover="code"] [onmouseup="code"] [onselect="code"]
  [readonly="true|false"] [style="style"] [styleClass="styleClass"]
  [tabindex="tabIndex"] [title="title"]
/>

Attributes

Attribute name

Java type

EL expression type

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.