planetj.html
Class HTMLItem

java.lang.Object
  extended byplanetj.html.HTMLElement
      extended byplanetj.html.HTMLItem
Direct Known Subclasses:
HTMLOption, HTMLRadioButton

public class HTMLItem
extends HTMLElement

An item in a list of items (such as a SELECT element, or group of radio button or checkbox inputs)


Field Summary
static short ORDER_DISPLAY_SORT
          Indicates that this option should ordered by its display text in the select
static short ORDER_FIRST
          Indicates that this option should be the first one in the select
static short ORDER_LAST
          Indicates that this option should be the last one in the select
 
Fields inherited from class planetj.html.HTMLElement
DISABLED, FOCUS_HTML_INPUT
 
Constructor Summary
HTMLItem()
           
 
Method Summary
 java.lang.String getDisplayText()
          Gets this option's display text
 short getOrder()
          Sets this option's order.
 java.lang.String getStyleClass()
          Gets the CSS style class of this option
 java.lang.String getValue()
          Returns the value.
 boolean isSelected()
          Tests if this option is selected
 void setDisplayText(java.lang.String displayText)
          Sets this option's display text
 void setOrder(short order)
          Sets this option's order.
 void setSelected(boolean selected)
          Sets if this option is selected
static boolean setSelected(java.util.List htmlItems, Field valueToSelect)
          Looks through a list of HTMLItems and sets the selected property on each one.
 void setStyleClass(java.lang.String styleClass)
          Gets the CSS style class of this option
 void setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from class planetj.html.HTMLElement
appendAttribute, appendAttribute, appendExtractableHiddenField, getFocusHTMLInput, getId, isDisplayField, setFocusHTMLInput, setId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_FIRST

public static final short ORDER_FIRST
Indicates that this option should be the first one in the select

See Also:
Constant Field Values

ORDER_LAST

public static final short ORDER_LAST
Indicates that this option should be the last one in the select

See Also:
Constant Field Values

ORDER_DISPLAY_SORT

public static final short ORDER_DISPLAY_SORT
Indicates that this option should ordered by its display text in the select

See Also:
Constant Field Values
Constructor Detail

HTMLItem

public HTMLItem()
Method Detail

setSelected

public static boolean setSelected(java.util.List htmlItems,
                                  Field valueToSelect)
                           throws CMException
Looks through a list of HTMLItems and sets the selected property on each one. The first one whose value is equal to the value contained in the field is set to selected=true. All other HTMLItems are set to selected=false.

Returns:
If one of the items in the list was set to selected=true
Throws:
CMException

getDisplayText

public java.lang.String getDisplayText()
Gets this option's display text


getOrder

public short getOrder()
Sets this option's order. This can either be an absoloute order or one of the special order constants


getStyleClass

public java.lang.String getStyleClass()
Gets the CSS style class of this option


getValue

public java.lang.String getValue()
Returns the value.

Returns:
String

isSelected

public boolean isSelected()
Tests if this option is selected


setDisplayText

public void setDisplayText(java.lang.String displayText)
Sets this option's display text


setOrder

public void setOrder(short order)
Sets this option's order. This can either be an absoloute order or one of the special order constants


setSelected

public void setSelected(boolean selected)
Sets if this option is selected


setStyleClass

public void setStyleClass(java.lang.String styleClass)
Gets the CSS style class of this option


setValue

public void setValue(java.lang.String value)
Sets the value.

Parameters:
value - The value to set