webuijsf
Tag form


Use the webuijsf:form tag to create an HTML <form> element. The form can be submitted via a button or hyperlink control (in which case an ActionEvent will be generated on the server), or via client side scripting.

The virtualFormsConfig attribute can be used to configure virtual forms. A virtual form defines a group of input components ("participants") and submission components ("submitters") on a page, such that when the user interacts with one of the submitters, the participants are processed exclusively while the remaining inputs on the page are ignored. An input component is any component that implements EditableValueHolder. A submission component is any component that causes the web page to be submitted (such as a button, hyperlink, or any input component that submits the page via the webui.suntheme.common.timeoutSubmitForm scripting function). Processing an input means converting and validating it, firing any value change events associated with the input, and mapping the input onto its binding target (if the component is bound). Virtual forms provide an alternative to the immediate property. They are more powerful than immediate because they let you specify multiple groups of inputs to be selectively processed (that is, you can specify multiple virtual forms on a page). They are also easier to use than immediate because they do not alter the JavaServer Faces lifecycle.


HTML Elements and Layout

The rendered HTML page contains an HTML <form> tag and its associated attributes. The rendered form includes a hidden field for use in determining which form submitted the page.


Client Side Javascript Functions

None.

Examples

Example 1: Using a Form

<webuijsf:page>
    <webuijsf:html>
        <webuijsf:head id="head" title="Hyperlink Test Page" />
        <webuijsf:body>
            <webuijsf:form id="form1">
                <webuijsf:hyperlink  id="hyperlinkSubmitsPage" 
                           label="#{HyperlinkBean.label}"
                           action="#{HyperlinkBean.determineWhatToDoFunction}" />
             </webuijsf:form>
       </webuijsf:body>
    </webuijsf:html>
</webuijsf:page>

Example 2: A Page with Three Virtual Forms

<webuijsf:page>
    <webuijsf:html>
        <webuijsf:head id="head" title="Shipping and Billing Information" />
        <webuijsf:body>
            <webuijsf:form id="form1" virtualFormsConfig="shipping | shippingAddressTextField | updateShippingButton , creditCard | creditCardDropDown | creditCardDropDown , billing | billingAddressTextfield creditCardDropDown | updateBillingButton">
                <webuijsf:label for="shippingAddressTextField" id="shippingAddressLabel" style="left: 48px; top: 48px; position: absolute" text="Shipping Address:"/>
                <webuijsf:textField id="shippingAddressTextField" required="true" style="left: 48px; top: 72px; position: absolute"/>                
                <webuijsf:button id="updateShippingButton" style="left: 48px; top: 120px; position: absolute" text="Update Shipping Address"/>
                <webuijsf:label id="creditCardLabel" for="creditCardDropDown" style="left: 48px; top: 192px; position: absolute" text="Credit Card to Use:"/>
                <webuijsf:dropDown id="creditCardDropDown" items="#{SessionBean1.creditCards}" style="left: 48px; top: 216px; position: absolute"/>
                <webuijsf:label id="billingAddressLabel" for="billingAddressTextfield" style="left: 48px; top: 264px; position: absolute" text="Credit Card Billing Address:"/>
                <webuijsf:textField id="billingAddressTextfield" required="true" style="left: 48px; top: 288px; position: absolute"/>
                <webuijsf:button id="updateBillingButton" style="left: 48px; top: 336px; position: absolute" text="Update Billing Address"/>
                <webuijsf:button id="updateAllButton" style="left: 48px; top: 432px; position: absolute" text="Update All Information"/>
             </webuijsf:form>
       </webuijsf:body>
    </webuijsf:html>
</webuijsf:page>



Tag Information
Tag Classcom.sun.webui.jsf.component.FormTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
bindingfalsefalsejava.lang.String A ValueExpression that resolves to the UIComponent that corresponds to this tag. This attribute allows the Java bean that contains the UIComponent to manipulate the UIComponent, its properties, and its children.
onMouseDownfalsefalsejava.lang.String

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.

onDblClickfalsefalsejava.lang.String

Scripting code executed when a mouse double click occurs over this component.

enctypefalsefalsejava.lang.String

Use this attribute to set the content-type of the HTTP request generated by this form. You do not normally need to set this attribute. Its default value is application/x-www-form-urlencoded. If there is an upload tag inside the form, the upload tag will modify the form's enctype attribute to multipart/form-data.

virtualFormsConfigfalsefalsejava.lang.String

The configuration of the virtual forms within this literal form, represented as a String. Each virtual form is described by three parts, separated with pipe ("|") characters: the virtual form name, a space-separated list of component ids that participate in the virtual form, and a space-separated list of component ids that submit the virtual form. Multiple such virtual form "descriptors" are separated by commas. The component ids may be qualified (for instance, "table1:tableRowGroup1:tableColumn1:textField1").

onKeyPressfalsefalsejava.lang.String

Scripting code executed when the user presses and releases a key while the component has focus.

targetfalsefalsejava.lang.String

Use this attribute to set the target of the XHTML form tag.

onMouseOutfalsefalsejava.lang.String

Scripting code executed when a mouse out movement occurs over this component.

renderedfalsefalsejava.lang.String Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission.
autoCompletefalsefalsejava.lang.String

Use this non-XHTML compliant boolean attribute to turn off autocompletion feature of Internet Explorer and Firefox browsers. Set to "false" to turn off completion. The default is "true".

idfalsetruejava.lang.StringNo Description
onMouseOverfalsefalsejava.lang.String

Scripting code executed when the user moves the mouse pointer into the boundary of this component.

onKeyUpfalsefalsejava.lang.String

Scripting code executed when the user releases a key while the component has focus.

onMouseMovefalsefalsejava.lang.String

Scripting code executed when the user moves the mouse pointer while over the component.

onMouseUpfalsefalsejava.lang.String

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.

styleClassfalsefalsejava.lang.String

CSS style class(es) to be applied to the outermost HTML element when this component is rendered.

onSubmitfalsefalsejava.lang.String

Scripting code executed when this form is submitted.

onResetfalsefalsejava.lang.String

Scripting code executed when this form is reset.

visiblefalsefalsejava.lang.String

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.

stylefalsefalsejava.lang.String

CSS style(s) to be applied to the outermost HTML element when this component is rendered.

onKeyDownfalsefalsejava.lang.String

Scripting code executed when the user presses down on a key while the component has focus.

onClickfalsefalsejava.lang.String

Scripting code executed when a mouse click occurs over this component.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.