C H A P T E R  14

form


<jato:form>

Renders an HTML <form> element. The form contents are described by the body content of this tag. The HTML form attribute action is not exposed in this tag because the tag handler dynamically constructs this attribute to be appropriate for the JATO runtime environment.

Note, the form tag does not have a view peer, nor can it be nested inside another JATO or HTML <form> element. However, it must be enclosed ultimately by a useViewBean tag. This tag may contain body content.

Example:

<jato:form name="form1" target="_top"/>

The above would be rendered into the following HTML:

<form name="form1" method="post" action="...(JATO URL)...">

...

</form>

Property Name

Description

Notes

accept

Specifies a comma-separated list of content types that a server processing this form will handle correctly. User agents may use this information to filter out non-conforming files when prompting a user to select files to be sent to the server.

 

acceptCharset

Specifies the list of character encodings for input data that is accepted by the server processing this form. The value is a space- and/or comma-delimited list of charset values. The client must interpret this list as an exclusive-or list, i.e., the server is able to accept any single character encoding per entity received.

The default value for this attribute is the reserved string "UNKNOWN". User agents may interpret this value as the character encoding that was used to transmit the document containing this FORM element.

 

defaultCommandChild

The name of a CommandField child which will be activated during a default request. A default request is a request that does not include specification of an activated command child. Such a situation will typically occur when the user presses the "Enter" key while in a form field, thereby resulting in submission of the enclosing form without choosing a particular button.

The view peer must be of type <JATO package>.view.CommandField

This name may be a qualified view path, using forward slashes ("/") as delimiters. All components in the path except the last must refer to a ContainerView or a derivative of ContainerView (such as TiledView). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

Examples:

defaultCommandChild="/okButton" (absolute from root view)

defaultCommandChild="okButton" (relative to current container)

defaultCommandChild="../okButton" (relative to parent)

RTExpr

elementId

Assigns a name to an element. This name must be unique in an HTML document. Please note, this corresponds to the HTML "id" attribute. It has no specific meaning to the JATO framework.

The id attribute has several roles in HTML:

  • As a style sheet selector
  • As a target anchor for hypertext links
  • As a means to reference a particular element from a script

RTExpr

encType

Specifies the content type used to submit the form to the server (when the value of method is "post").The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file".

RTExpr

method

Valid values: "post" or "get"

The HTTP method that will be used to submit this request. If not specified, value will be "post".

 

name

The name of the form element within the enclosing HTML document. This name is arbitrary and not related to any peer instance

 

style

CSS styles to be applied to this HTML element.

RTExpr

styleClass

CSS stylesheet class to be applied to this HTML element.

RTExpr

target

Window target to which this form is submitted.

RTExpr

 

This tag also supports the following JavaScript events:

onReset, onSubmit