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
Note
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.
Note
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 action="/servlet/test.JspTest" Classlib setAction("/servlet/test.JspTest") |
|
defaultButton |
* |
String (cs) |
Classlib setDefaultButton(Button OKButton) |
encodingType |
String |
Taglib encodingType="multipart/mime" Classlib setEncodingType("multipart/mime") |
|
focusedControl |
Component |
Classlib setFocusedControl(Button OKButton) setFocusedControl(DropdownListBox dlb) setFocusedControl(InputField inp_field) setFocusedControl(TextEdit text_edit) |
|
id |
* |
String (cs) |
Taglib id="SAPForm" |
language |
String |
Taglib language="de" Classlib setLanguage("de") |
|
messageBar |
Component |
Classlib setMessagBar(MessageBar bar) |
|
messageBarAt FormEnd |
FALSE (d) TRUE |
Classlib setMessageBarAtFormEnd(true) |
|
messageBar Required |
FALSE (d) TRUE |
Classlib setMessageBarRequired(true) |
|
method |
POST (d) GET |
Taglib method="POST" Classlib setMethod("POST") |
|
scrollingToLast Position |
* |
FALSE (d) TRUE |
Classlib setScrollingToLastPosition(true) |
target |
_blank _self (d) _parent _top |
Taglib target="_blank" Classlib setTarget("_blank") |
|
userDefined MessageBar |
FALSE (d) TRUE |
Classlib setUserDefinedMessageBar(true) |
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.
Syntax
<hbj:form id="myFormId" method="post" target="_blank" encodingType="multipart/form-data" action="/htmlb/servlet/com.sap.htmlb.test.MyTestJsp1Test"> This form submits to a new web client window <br> because of 'target=_blank'. <br> <br> <hbj:inputField id="myInputField1" type="String" invalid="false" width="310" value="After editing press <Enter> to submit" visible="true" disabled="false" required="true" maxlength="30" size="50"> </hbj:inputField> <br> <br> <hbj:button id="oKbutton" text="OK" onClick="onOKClick" design="EMPHASIZED" width="100"> <% myFormId.setDefaultButton(oKbutton); %> </hbj:button> <hbj:button id="Infobutton" text="Info" onClick="onInfoClick" width="100" /> <hbj:button id="Cancelbutton" text="Cancel" onClick="onCanClick" width="100" /> </hbj:form>