BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.html
Class OptionElement

java.lang.Object
  |
  +--weblogic.html.HtmlElement
        |
        +--weblogic.html.ElementWithAttributes
              |
              +--weblogic.html.SinglePartElement
                    |
                    +--weblogic.html.OptionElement

public class OptionElement
extends SinglePartElement

Use OptionElement objects to build a SelectElement. A SelectElement displays a list from which the user makes choices from a dropdown-type combo box. An OptionElement object has a string that is display and an associated value that is not displayed.

Version:
2.2
Author:
Copyright (c) 1995-96, WebLogic, Inc.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
SelectElement

Fields inherited from class weblogic.html.HtmlElement
codeset, useObsolete
 
Constructor Summary
OptionElement()
          Constructs an empty OptionElement.
OptionElement(java.lang.String str)
          Constructs an OptionElement with the specified string.
OptionElement(java.lang.String str, boolean isselected)
          Constructs an OptionElement with the specified string and sets the SELECTED property as specified.
OptionElement(java.lang.String contstr, java.lang.String val)
          Constructs an OptionElement with the specified string and the specified value.
OptionElement(java.lang.String str, java.lang.String val, boolean isselected)
          Constructs an OptionElement with the specified string and value and sets the SELECTED property as specified.
 
Method Summary
protected  java.lang.String getHtmlCode()
           
 java.lang.String getText()
          Gets a string representation of an OptionElement.
 java.lang.String getValue()
          Gets the value property of an OptionElement.
 boolean isSelected()
          Determines whether an OptionElement is selected.
protected  boolean printCR()
           
protected  boolean printEndingTag()
           
 OptionElement setSelected(boolean val)
          Sets the SELECTED attribute of an OptionElement.
 OptionElement setText(java.lang.String str)
          Sets the TEXT attribute of an OptionElement.
 OptionElement setValue(java.lang.String str)
          Sets the VALUE attribute of an OptionElement.
 
Methods inherited from class weblogic.html.SinglePartElement
getElement, printBody, printBody, printBody, setElement, setElement, widthAsLiteral
 
Methods inherited from class weblogic.html.ElementWithAttributes
addAttribute, addAttribute, escapeQuotes, getBooleanAttribute, getElementAttribute, getLocalVar, getQuotedAttribute, output, output, output, printBody, setBooleanAttribute, setBooleanAttribute, setClass, setDirection, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setElementAttribute, setId, setLang, setLocalVar, setQuotedAttribute, setStyle
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionElement

public OptionElement()
Constructs an empty OptionElement.

OptionElement

public OptionElement(java.lang.String str)
Constructs an OptionElement with the specified string. Sets both the value and the text to the string.

Parameters:
str - String text

OptionElement

public OptionElement(java.lang.String contstr,
                     java.lang.String val)
Constructs an OptionElement with the specified string and the specified value.

Parameters:
str - String text
val - Value for option element

OptionElement

public OptionElement(java.lang.String str,
                     boolean isselected)
Constructs an OptionElement with the specified string and sets the SELECTED property as specified.

Parameters:
str - String text
isselected - True if element should be selected

OptionElement

public OptionElement(java.lang.String str,
                     java.lang.String val,
                     boolean isselected)
Constructs an OptionElement with the specified string and value and sets the SELECTED property as specified.

Parameters:
str - String text
val - Value for option element
isselected - True if element should be selected
Method Detail

printCR

protected boolean printCR()

Overrides:
printCR in class ElementWithAttributes

printEndingTag

protected boolean printEndingTag()

Overrides:
printEndingTag in class ElementWithAttributes

getHtmlCode

protected java.lang.String getHtmlCode()

Overrides:
getHtmlCode in class ElementWithAttributes

getValue

public java.lang.String getValue()
Gets the value property of an OptionElement.

Returns:
String

getText

public java.lang.String getText()
Gets a string representation of an OptionElement.

Returns:
String

isSelected

public boolean isSelected()
Determines whether an OptionElement is selected.

Returns:
True if the OptionElement is selected

setValue

public OptionElement setValue(java.lang.String str)
Sets the VALUE attribute of an OptionElement.

Parameters:
str - Value to set

setText

public OptionElement setText(java.lang.String str)
Sets the TEXT attribute of an OptionElement.

Parameters:
str - String to set

setSelected

public OptionElement setSelected(boolean val)
Sets the SELECTED attribute of an OptionElement. Setting the SELECTED attribute for more than one OptionElement in a SelectElement should be done only if the SelectElement.setMultipleSelect() is set to true.

Parameters:
str - True if this option should be selected by default

Documentation is available at
http://www.weblogic.com/docs51