Is the outer shell of the document and encapsulates normal content, markup, controls and labels of those controls. Forms are essential for the event handling.
·
action
Defines the form
processing agent. For example, the value might be a HTTP URI to submit the
form to a program or a mailto URI to email the form.
·
defaultButton
Defines the default
button for this document. This button will fire an event if the user presses
the RETURN / ENTER key in the web agent. Usually the button should have the
'design' "EMPHASIZED" to graphically show that this button is the default
button.
If you write an application for different web clients you should be aware of
the fact that every web client has its own way to handle keyboard input. To
achieve the right results on all web clients you should use the default button
always together with an inputField and the inputField must have the focus
(usually the inputField gets the focus because the user clicked on this field
to do some input). In this case the onClick event of the default button will
be fired when the user presses RETURN / ENTER in the inputField.
·
encodingType
Defines the content type
(MIME type) used to submit the form to the web server. Examples of content
types can be found at internet address www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html#h-17.3
If you use a fileUpload control in the JSP you must set the encondingType attribute to "multipart/form-data".
Example:
<hbj:form
encodingType="multipart/form-data">
·
focusedControl
Defines the control
which has the focus when the page is loaded. The attribute 'focusedControl'
for buttons works like the attribute 'defaultButton'. As extension to the
'defaultButton' attribute, the 'focusedControl' attribute can set the focus to
dropdownListBoxes, inputFields and textEdit controls.
·
id
Identification name of
the form.
·
language
Defines the language
code for this document. The attribute defines the primary language and can
define a series of sub languages. The language code is according to ISO 639.
The language code and the description can be found at internet address
www.w3.org/TR/1998/REC-HTML40-19980424/references.html#ref-RFC1766
·
messageBar
Sets a messageBar
for the form.
·
messageBarAtFormEnd
A boolean value that sets the messageBar at the bottom of the form.
·
messageBarRequired
A boolean value that defines if a messageBar is required for this form.
·
method
Defines the HTTP method that will be used to submit the form data set. The
form data set is a sequence of control name/current value pairs constructed
from successful controls. A successful control is "valid" for submission.
Every control has its control name paired with its current value as part of
the submitted form data set. A successful control must be defined within a
form and must have a control name.
The control name is generated by the HTML-Business for Java renderer. So you have no way to address the control via for example, JavaScript.
¡
GET
The form data set is appended to the URI specified by the action attribute
(with a question-mark (?) as separator) and this new URI is sent to the
processing web agent.
¡
POST
The form data set is included in the body of the form and sent to the
processing web agent.
The default method is POST and should not be altered (Limits of GET requests can cause problems).
·
scrollingToLastPosition
A boolean value that controls the position in a form. By default the position
in a form is always reset to "top of form" when the form is submitted (for
example, in case of an event). If the 'scrollingToLastPosition' attribute is
set to true the last position in the form is saved and restored on a submit.
·
target
Specifies the name of
the frame where the document is to be opened. The following values refer to
w3c HTML-standard.
¡
_blank
The web client should load the designated document in a new, unnamed window.
¡
_self
The web client should load the document in the same frame as the element that
refers to the target.
¡
_parent
The web client should load the document into the immediate FRAMESET parent of
the current frame. This value is equivalent to _self if the current frame has
no parent.
¡
_top
The web client should load the document into the full, original window (thus
canceling all other frames). This value is equivalent to _self if the current
frame has no parent.
·
userDefinedMessageBar
A boolean value that
defines if a user defined messageBar is used for this form.
Attributes |
M |
Values |
Usage |
action |
|
String (cs) |
Taglib Classlib |
defaultButton |
* |
String (cs) |
Classlib |
encodingType |
|
String |
Taglib Classlib |
focusedControl |
|
Component |
Classlib setFocusedControl(DropdownListBox dlb) setFocusedControl(InputField inp_field) setFocusedControl(TextEdit text_edit) |
id |
* |
String (cs) |
Taglib |
language |
|
String |
Taglib Classlib |
messageBar |
|
Component |
Classlib |
messageBarAt |
|
FALSE (d) |
Classlib |
messageBar |
|
FALSE (d) |
Classlib |
method |
|
POST (d) |
Taglib Classlib |
scrollingToLast |
* |
FALSE (d) |
Classlib |
target |
|
_blank |
Taglib Classlib |
userDefined |
|
FALSE (d) |
Classlib |
This
example also shows the definition of a default button. We define the
OKbutton as default.
The assignment is made by scripting (<% %>) and has to be done where the
button is defined.
<hbj:form |