jaxcent
Class HtmlSelect

java.lang.Object
  extended byjaxcent.JaxcentObject
      extended byjaxcent.JaxcentHtmlElement
          extended byjaxcent.HtmlSelect

public class HtmlSelect
extends JaxcentHtmlElement

The class HtmlSelect corresponds to SELECT tags on the page.


Constructor Summary
HtmlSelect(JaxcentPage page, SearchType searchType, java.lang.String str)
          Search for HTML element on page by specified search type and search string.
HtmlSelect(JaxcentPage page, SearchType searchType, java.lang.String[] attributes, java.lang.String[] values)
          Create new HTML element on page using the specified attributes and values.
HtmlSelect(JaxcentPage page, SearchType searchType, java.lang.String str, int index)
          Search for HTML Element on page by specified search type and search string, and search index.
HtmlSelect(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String text)
          Create new HTML Element on page using the specified tag.
HtmlSelect(JaxcentPage page, SearchType searchType, java.lang.String text, java.lang.String[] attributes, java.lang.String[] values)
          Create new HTML element on page using the specified text and attributes and values.
HtmlSelect(JaxcentPage page, java.lang.String id)
          Search for HTML element on page by specified ID
 
Method Summary
 void blur()
          Lose the input focus.
 void deleteAllOptions()
          Remove all OPTIONs.
 void deleteFromBottom(int n)
          Remove N options from bottom.
 void deleteFromTop(int n)
          Remove N options from top.
 void deleteOption(int index)
          Delete the OPTION at the specified index.
 void focus()
          Get the input focus.
 boolean getDisabled()
          Retrieve the "disabled" property
 int getLength()
          Retrieve the "length" property
 boolean getMultiple()
          Whether multiple items can be selected
 java.lang.String getName()
          Retrieve the "name" property
 int getNumOptions()
          Returns the number of OPTIONS in the select.
 HtmlOption getOption(int index)
          Return the OPTION at the specified index.
 int getSelectedIndex()
          Retrieve the "selectedIndex" property
 int getSize()
          Retrieve the "size" property
 int getWidth()
          Retrieve the "width" property
 HtmlOption insertOption(int index, java.lang.String optionText)
          Insert an OPTION in the SELECT at the specified index.
 HtmlOption insertOption(int index, java.lang.String optionText, java.lang.String[] attributes, java.lang.String[] values)
          Insert an OPTION in the SELECT at the specified index.
protected  void onBlur()
          Override to handle the "blur" event
protected  void onChange()
          Override to handle the "change" event
protected  void onChange(int selectedIndex)
          Override to handle the "change" event and receive current selected index
protected  void onChange(java.lang.String value)
          Override to handle the "change" event and receive current element value
protected  void onClick()
          Override to handle the "click" event
protected  void onFocus()
          Override to handle the "focus" event
 void setDisabled(boolean value)
          Set the "disabled" property
 void setMultiple(boolean value)
          Sets whether multiple items can be selected
 void setName(java.lang.String value)
          Set the "name" property
 void setSelectedIndex(int value)
          Set the "selectedIndex" property
 void setSize(int value)
          Set the "size" property
 void setWidth(int value)
          Set the "width" property
 void sizeToOptions()
          Set SIZE of SELECT same as the number of options.
 
Methods inherited from class jaxcent.JaxcentHtmlElement
getAttribute, getID, getInnerText, getStyle, getTag, hide, insertAfter, insertAtBeginning, insertAtBeginning, insertAtEnd, insertAtEnd, insertBefore, setAttribute, setInnerText, setStyle, setStyle, setStyle, setStyle, setVisible, show
 
Methods inherited from class jaxcent.JaxcentObject
addJavaScriptVerification, getId, getProperty, setId, setProperty, setProperty, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlSelect

public HtmlSelect(JaxcentPage page,
                  java.lang.String id)
Search for HTML element on page by specified ID


HtmlSelect

public HtmlSelect(JaxcentPage page,
                  SearchType searchType,
                  java.lang.String str)
Search for HTML element on page by specified search type and search string. If the search returns multiple objects, use the first one.


HtmlSelect

public HtmlSelect(JaxcentPage page,
                  SearchType searchType,
                  java.lang.String str,
                  int index)
Search for HTML Element on page by specified search type and search string, and search index. The search is expected to return multiple results. The search index is 0-based, and specifies the index in the multiple results. This constructor is not for use with createNew.


HtmlSelect

public HtmlSelect(JaxcentPage page,
                  SearchType searchType,
                  java.lang.String tag,
                  java.lang.String text)
           throws Jaxception
Create new HTML Element on page using the specified tag. Search type must be createNew and tag must be "SELECT". If text is non null, the new element is populated with that text.


HtmlSelect

public HtmlSelect(JaxcentPage page,
                  SearchType searchType,
                  java.lang.String[] attributes,
                  java.lang.String[] values)
           throws Jaxception
Create new HTML element on page using the specified attributes and values. Search type must be createNew. Attributes and values arrays must have the same length.


HtmlSelect

public HtmlSelect(JaxcentPage page,
                  SearchType searchType,
                  java.lang.String text,
                  java.lang.String[] attributes,
                  java.lang.String[] values)
           throws Jaxception
Create new HTML element on page using the specified text and attributes and values. Search type must be createNew. Attributes and values arrays must have the same length.

Method Detail

onClick

protected void onClick()
Override to handle the "click" event


onFocus

protected void onFocus()
Override to handle the "focus" event


onBlur

protected void onBlur()
Override to handle the "blur" event


onChange

protected void onChange()
Override to handle the "change" event


onChange

protected void onChange(java.lang.String value)
Override to handle the "change" event and receive current element value


onChange

protected void onChange(int selectedIndex)
Override to handle the "change" event and receive current selected index


getNumOptions

public int getNumOptions()
                  throws Jaxception
Returns the number of OPTIONS in the select.

Throws:
Jaxception

getOption

public HtmlOption getOption(int index)
                     throws Jaxception
Return the OPTION at the specified index.

Throws:
Jaxception

deleteOption

public void deleteOption(int index)
                  throws Jaxception
Delete the OPTION at the specified index.

Throws:
Jaxception

insertOption

public HtmlOption insertOption(int index,
                               java.lang.String optionText)
                        throws Jaxception
Insert an OPTION in the SELECT at the specified index. If index is -1, the OPTION is inserted at the end.

Throws:
Jaxception

insertOption

public HtmlOption insertOption(int index,
                               java.lang.String optionText,
                               java.lang.String[] attributes,
                               java.lang.String[] values)
                        throws Jaxception
Insert an OPTION in the SELECT at the specified index. If index is -1, the OPTION is inserted at the end. The attributes and value arrays must have the same length. These attributes are added to the option.

Throws:
Jaxception

deleteAllOptions

public void deleteAllOptions()
                      throws Jaxception
Remove all OPTIONs. Useful before inserting new OPTIONs.

Throws:
Jaxception

deleteFromTop

public void deleteFromTop(int n)
                   throws Jaxception
Remove N options from top. If N is negative, keep -N (abs N) options, remove rest from top.

Throws:
Jaxception

deleteFromBottom

public void deleteFromBottom(int n)
                      throws Jaxception
Remove N options from bottom. If N is negative, keep -N (abs N) options, remove rest from bottom.

Throws:
Jaxception

sizeToOptions

public void sizeToOptions()
                   throws Jaxception
Set SIZE of SELECT same as the number of options.

Throws:
Jaxception

setDisabled

public void setDisabled(boolean value)
                 throws Jaxception
Set the "disabled" property

Throws:
Jaxception

getDisabled

public boolean getDisabled()
                    throws Jaxception
Retrieve the "disabled" property

Throws:
Jaxception

getLength

public int getLength()
              throws Jaxception
Retrieve the "length" property

Throws:
Jaxception

setMultiple

public void setMultiple(boolean value)
                 throws Jaxception
Sets whether multiple items can be selected

Throws:
Jaxception

getMultiple

public boolean getMultiple()
                    throws Jaxception
Whether multiple items can be selected

Throws:
Jaxception

setName

public void setName(java.lang.String value)
             throws Jaxception
Set the "name" property

Throws:
Jaxception

getName

public java.lang.String getName()
                         throws Jaxception
Retrieve the "name" property

Throws:
Jaxception

setSelectedIndex

public void setSelectedIndex(int value)
                      throws Jaxception
Set the "selectedIndex" property

Throws:
Jaxception

getSelectedIndex

public int getSelectedIndex()
                     throws Jaxception
Retrieve the "selectedIndex" property

Throws:
Jaxception

setSize

public void setSize(int value)
             throws Jaxception
Set the "size" property

Throws:
Jaxception

getSize

public int getSize()
            throws Jaxception
Retrieve the "size" property

Throws:
Jaxception

setWidth

public void setWidth(int value)
              throws Jaxception
Set the "width" property

Throws:
Jaxception

getWidth

public int getWidth()
             throws Jaxception
Retrieve the "width" property

Throws:
Jaxception

blur

public void blur()
          throws Jaxception
Lose the input focus.

Throws:
Jaxception

focus

public void focus()
           throws Jaxception
Get the input focus.

Throws:
Jaxception