BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

Class FieldType


public class FieldType
extends MarkupElement

The FieldType class contains variables for setting the attribute of an InputElement added to an htmlKona FormElement.

Here's an example of how you might add a hidden field and a button to a FormElement "form". Note that not all browsers support hidden input fields.

   form.addElement(new InputElement("numitems", FieldType.hidden).setValue(0))
       .addElement(new ButtonElement("Submit"));
Notes that are provided about types in this class conform to HTML 4.0.

Copyright (c) 1995-97, WebLogic, Inc.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
InputElement, ButtonElement, FormElement

Field Summary
static FieldType button
          Input field is a button.
static FieldType checkbox
          Input field is a checkbox.
static FieldType file
          Input field is a file, for users to attach a file to the form's contents when submitted.
static FieldType hidden
          Input field is a hidden field.
static FieldType image
          Input field is an image.
static FieldType password
          Input field is a password field that echoes a single generic character (like an asterisk) as the user types.
static FieldType radio
          Input field is a radio button.
static FieldType reset
          Input field is a reset button to clear the form.
static FieldType submit
          Input field is a submit button.
static FieldType text
          Input field is a text area.
Fields inherited from class weblogic.html.MarkupElement
BeginAddress, BeginAddressStr, BeginBlockquote, BeginBlockquoteStr, BeginBody, BeginBodyStr, BeginBold, BeginBoldStr, BeginCenter, BeginCenterStr, BeginComment, BeginCommentStr, BeginDiv, BeginDivStr, BeginHeadStr, BeginHtml, BeginHtmlStr, BeginItalic, BeginItalicStr, BeginLiteral, BeginLiteralStr, BeginParagraph, BeginParagraphStr, BeginScriptStr, BeginTitle, BeginTitleStr, Break, BreakStr, contents, CR, CRStr, EndAddress, EndAddressStr, EndBlockquote, EndBlockquoteStr, EndBody, EndBodyStr, EndBold, EndBoldStr, EndCenter, EndCenterStr, EndComment, EndCommentStr, EndDiv, EndDivStr, EndFont, EndFontStr, EndHeadStr, EndHtml, EndHtmlStr, EndItalic, EndItalicStr, EndLiteral, EndLiteralStr, EndParagraph, EndParagraphStr, EndScriptStr, EndTitle, EndTitleStr, HorizontalLine, HorizontalLineStr, HorizontalRule, NoBreak, NoBreakStr, WordBreak, WordBreakStr
Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
Constructor Summary
FieldType(java.lang.String str)
          Constructs the specified type of input field.
Method Summary
 void output( out)
          Outputs a FieldType to the specified output stream.
Methods inherited from class weblogic.html.MarkupElement
BeginFont, BeginFontFace, BeginFontSize, BeginHeader, EndHeader, output, output, setContents
Methods inherited from class weblogic.html.HtmlElement
asAnchorElement, asBigElement, asBlockquoteElement, asBoldElement, asCenteredElement, asCiteElement, asCodeElement, asCommentElement, asDefineTermElement, asEmphasisElement, asFontElement, asFontElement, asFontElement, asHtmlContainer, asItalicElement, asKeyboardElement, asLiteralElement, asParagraphElement, asSampleElement, asSmallElement, asStrikeElement, asStrongElement, asSubscriptElement, asSuperscriptElement, asTeletypeElement, asUnderlineElement, asVariableElement, getVersion, setAnchorMode, setCodeset, toString, toString, widthAsLiteral
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static FieldType button
Input field is a button.


public static FieldType checkbox
Input field is a checkbox. Use the InputElement.setChecked() method in to set the value to "on". Group checkboxes by giving each the same name (InputElement.setName()) and a different value (InputElement.setValue()).


public static FieldType file
Input field is a file, for users to attach a file to the form's contents when submitted. Most browsers render this with a text field and an associated button which when clicked invokes a dialog to browse for a file name. Use InputElement.setSize() and InputElement.setMaxlen() as you would for text fields. Some browsers allow you to restrict the file types that can be submitted with the ACCEPT attribute, which takes a comma-delimited list of MIME content types (InputElement.setAccept() method). Further information is contained in RFC 1867.


public static FieldType hidden
Input field is a hidden field. Browsers should not render this type of field, although not all browsers comply. This provides a means of storing state information with a form that will be passed back to the server. Use InputElement.setName() and InputElement.setValue() to establish a name/value pair.


public static FieldType image
Input field is an image. This is used for graphical Submit buttons rendered by an image rather than a text string. Use the InputElement.setSource() methods to set a SRC for the image (required). The ALIGN attribute for the image can be used to set alignment to left, right, top, middle, or bottom. Use InputElement.setName() and InputElement.setValue() just as you would for textual submit buttons.


public static FieldType password
Input field is a password field that echoes a single generic character (like an asterisk) as the user types. Use InputElement.setSize() and InputElement.setMaxlen() to control visible and maximum length, as with regular text fields.


public static FieldType radio
Input field is a radio button. Use the InputElement.setChecked() method to set a radio button to "on". Each radio button in the group should be given the same name (InputElement.setName()). Radio buttons require an explicit value (InputElement.setValue()). Only the checked radio button in a group generates a name/value pair when submitted. One radio button in a group should be initially checked.


public static FieldType reset
Input field is a reset button to clear the form. Set a label with InputElement.setValue(). Reset buttons are never sent as part of the form's submitted contents.


public static FieldType submit
Input field is a submit button. Set the label with InputElement.setValue(). If a name attribute is set (InputElement.setName()), the submit button's name/value pair will be submitted with data. There can be multiple submit buttons on a form.


public static FieldType text
Input field is a text area. Visible size can be set using the InputElement.setSize() method; enforce a max limit on number of characters allowed with the InputElement.setMaxlen() method. Name the field with InputElement.setName(). Set a string for display after loading with InputElement.setValue().
Constructor Detail


public FieldType(java.lang.String str)
Constructs the specified type of input field.
Method Detail


public void output( out)
Outputs a FieldType to the specified output stream.

out - OutputStream
Throws: - if there is an IO error
output in class MarkupElement

Documentation is available at