ArticlesTutorialsInterview Questions & AnswersCertificationsFree Books & Sample ChaptersTechnical Discussions  Your Account | Advertise with us | Feedback |
Few pages of this site are under construction and we are constantly trying to improve it. If you have any suggestions or ideas about how to improve the site, please Let us know.
JSF tag reference - h:form

 h:outputLabel                         JSF Tag Home h:grapicImage 

<h:form>

Contents
  1. Description
  2. Example
  3. Tag Attributes
  4. Code Generator


h:form Description

This tag represents the javax.faces.component.UIForm class of underlying component tree. A UIForm component is an input form with child components representing data that is either presented to the user or submitted with the form. The form tag encloses all of the controls that display or collect data from the user.

The form tag can also include HTML markup to layout the controls on the page. The form tag itself does not perform any layout; its purpose is to collect data and to declare attributes that can be used by other components in the form.A page can include multiple form tags, but only the values from the form that the user submits will be included in the postback.

  • Use <h:form> element is encoded as an HTML <form> element.
  • Encloses all of the controls that display or collect data from the user.
  • The encoded form has an action attribute referencing the original JSF page and method attribute set to POST.
  • JSF will determine where the request should be processed based upon navigation entries in faces-config.xml.
  • If id attribute is not defined, then one will be created with a generated value.
  • The id is used to referencing the component by name.
  • A page can include multiple form tags, but only the values from the form that the user submits will be included in the postback..



h:form Example


JSF Code HTML Output
<h:form>
..........
</h:form>
<form id="j_id_jsp_730696170_1" name="j_id_jsp_730696170_1" 
method
="post" action="/jsfTags/index.faces;jsessionid=77A193112398D3884EA1D25FE2A0ED92"
enctype="application/x-www-form-urlencoded">
</form>

h:form Attributes


Attribute Description Type
id
The unique identifier value for this component. The value must be unique within the closest naming container (e.g.,h:form or f:subview).This value must be a static value.
String
binding
The value-binding expression linking this component tag to a backing bean property.
String
rendered
A boolean value that indicates whether this component should be rendered.Default value: true.
String
prependId
Flag indicating whether or not this form should prepend its id to its descendent's id during the clientId generation process. If this flag is not set, the default value is true
String
dir
The dir attribute is a standard HTML attribute that overrides the default text directionality for this component. The values accepted for this component are "LTR" (left-to-right) and "RTL" (right-to-left).
String
lang
Code describing the language used in the generated markup for this component
String
style
The style attribute sets the CSS style definition to be applied to this component when it is rendered.
String
title
An advisory title for this element. Often used by the user agent as a tooltip.
String
styleClass
The styleClass attribute sets the CSS class to apply to this component when it is rendered.
String
onclick
Sets the JavaScript code to execute when the mouse pointer is clicked over this element.
String
ondblclick
Sets the JavaScript code to execute when the mouse pointer is double-clicked over this element.
String
onmousedown
Sets the JavaScript code to execute when the mouse pointer is pressed down over this element.
String
onmouseup
Sets the JavaScript code to execute when the mouse button is released over this element.
String
onmouseover
Sets the JavaScript code to execute when the mouse pointer is moved onto this element.
String
onmousemove
Sets the JavaScript code to execute when the mouse pointer is moved within this element.
String
onmouseout
Sets the JavaScript code to execute when the mouse pointer is moved away from this element.
String
onkeypress
Sets the Javascript code to execute when a key is pressed and released over this element.
String
onkeydown
Sets the Javascript code to execute when a key is pressed down over this element.
String
onkeyup
Sets the Javascript code to execute when a key is released over this element.
String
onreset
The onreset attribute sets the JavaScript code to execute when the form is reset.
String
onsubmit
The onsubmit attribute sets the JavaScript code to execute when the form is submitted.
String
target
Name of a frame where the resource retrieved via this hyperlink is to be displayed.
String
accept
The accept attribute identifies the list of content types that the server processing this form is able to handle.
String
acceptCharset
The acceptcharset attribute identifies the list of character encodings for user input data that the server processing this form will accept.
String
enctype
The enctype attribute sets the content type of the data to be submitted to the server. The default value for this attribute is "application/x-www-form-urlencoded".
String
 h:outputLabel                         JSF Tag Home h:grapicImage 
Test

  ALSO SEE :

About Us | Our Mission | Terms of use | Author Terms |    Search        | Contact Us | Advertise With Us | Link to Us | Sitemap
Copyright © 2016 developersBOOK.COM. All rights reserved.