The <o:form> is a component that extends the standard <h:form> and submits to
exactly the request URI with query string as seen in browser's address. Standard Faces <h:form>
submits to the view ID and does not include any query string parameters or path parameters and may therefore fail
in cases when the form is submitted to a request scoped bean which relies on the same initial query string parameters
or path parameters still being present in the request URI. This is particularly useful if you're using FacesViews or
forwarding everything to 1 page.
Additionally, it offers in combination with the <o:ignoreValidationFailed> tag on an
UICommand component the possibility to ignore validation failures so that the invoke action phase will be
executed anyway.
Since version 2.1 this component also supports adding query string parameters to the action URL via nested
<f:param> and <o:param>.
Since version 3.0, it will also during ajax requests automatically send only the form data which actually need to
be processed as opposed to the entire form, based on the execute attribute of any nested
<f:ajax>. This feature is similar to partialSubmit feature of PrimeFaces.
This will reduce the request payload when used in large forms such as editable tables.
You can use it the same way as <h:form>, you only need to change h: to
o:.
This was available since version 1.6, but since version 3.0, this has become enabled by default. So just using
<o:form> will already submit to the exact request URI with query string as seen in browser's
address bar. In order to turn off this behavior, set useRequestURI attribute to false.
<o:form useRequestURI="false">
When you want to include request parameters only instead of the entire request URI with query string, set the
includeRequestParams attribute to true. This will implicitly set useRequestURI
attribute to false.
<o:form includeRequestParams="true">
This is the default behavior. So just using <o:form> will already cause the
<f:ajax> to send only the form data which actually need to be processed. In order to turn off this
behavior, set partialSubmit attribute to false.
<o:form partialSubmit="false">
The standard UIForm doesn't support adding query string parameters to the action URL. This component offers
this possibility via nested <f:param> and <o:param>.
<o:form>
<f:param name="somename" value="somevalue" />
...
</o:form>
The <f|o:param> will override any included view or request parameters on the same name. To conditionally add
or override, use the disabled attribute of <f|o:param>.
The support was added in OmniFaces 2.2.
In order to properly use the <o:ignoreValidationFailed> tag on an UICommand component, its
parent <h:form> component has to be replaced by this <o:form> component.
See also IgnoreValidationFailed.
| Info | Value |
|---|---|
| Component Type | org.omnifaces.component.input.Form |
| Handler Class | None |
| Renderer Type | None |
| Description | None |
| Name | Required | Type | Description |
|---|---|---|---|
accept | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| List of content types that a server processing this form will handle correctly |
acceptcharset | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| List of character encodings for input data that are accepted by the server processing this form. |
binding | false | jakarta.el.ValueExpression
(must evaluate to jakarta.faces.component.UIComponent)
| The ValueExpression linking this component to a property in a backing bean. |
dir | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left). |
enctype | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Content type used to submit the form to the server. If not specified, the default value is "application/x-www-form-urlencoded". |
id | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| The component identifier for this component. This value must be unique within the closest parent component that is a naming container. |
ignoreValidationFailed | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Whether the form should ignore validation fail (and thus proceed to update model/invoke action). |
includeRequestParams | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Whether or not the request parameters should be encoded into the form's action URL. Defaults to
false. |
lang | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Code describing the language used in the generated markup for this component. |
onclick | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is clicked over this element. |
ondblclick | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is double clicked over this element. |
onkeydown | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a key is pressed down over this element. |
onkeypress | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a key is pressed and released over this element. |
onkeyup | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a key is released over this element. |
onmousedown | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is pressed down over this element. |
onmousemove | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is moved within this element. |
onmouseout | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is moved away from this element. |
onmouseover | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is moved onto this element. |
onmouseup | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when a pointer button is released over this element. |
onreset | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when this form is reset. |
onsubmit | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Javascript code executed when this form is submitted. |
partialSubmit | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Whether to send only the form data which actually need to be processed as opposed to the entire form.
Defaults to true. |
rendered | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. |
role | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Per the WAI-ARIA spec and its relationship to HTML5 (Section title ARIA Role Attriubute), every HTML element may have a "role" attribute whose value must be passed through unmodified on the element on which it is declared in the final rendered markup. The attribute, if specified, must have a value that is a string literal that is, or an EL Expression that evaluates to, a set of space-separated tokens representing the various WAI-ARIA roles that the element belongs to. It is the page author's responsibility to ensure that the user agent is capable of correctly interpreting the value of this attribute. |
style | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| CSS style(s) to be applied when this component is rendered. |
styleClass | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the "class" attribute on generated markup. |
target | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Name of a frame where the response retrieved after this form submit is to be displayed. |
title | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| Advisory title information about markup elements generated for this component. |
useRequestURI | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Whether the request URI should be used as form's action URL. Defaults to true.
This setting is ignored when includeRequestParams is set to true. |
Output generated by Vdldoc View Declaration Language Documentation Generator.