Methods Summary |
---|
public void | add(org.w3c.dom.html.HTMLElement element, org.w3c.dom.html.HTMLElement before)
insertBefore( element, before );
|
public void | blur()
// No scripting in server-side DOM. This method is moot.
|
public void | focus()
// No scripting in server-side DOM. This method is moot.
|
public org.w3c.dom.NodeList | getChildNodes()
return getChildNodesUnoptimized();
|
public boolean | getDisabled()
return getBinary( "disabled" );
|
public int | getLength()
return getOptions().getLength();
|
public boolean | getMultiple()
return getBinary( "multiple" );
|
public java.lang.String | getName()
return getAttribute( "name" );
|
public org.w3c.dom.html.HTMLCollection | getOptions()
if ( _options == null )
_options = new HTMLCollectionImpl( this, HTMLCollectionImpl.OPTION );
return _options;
|
public int | getSelectedIndex()
NodeList options;
int i;
// Use getElementsByTagName() which creates a snapshot of all the
// OPTION elements under this SELECT. Access to the returned NodeList
// is very fast and the snapshot solves many synchronization problems.
// Locate the first selected OPTION and return its index. Note that
// the OPTION might be under an OPTGROUP.
options = getElementsByTagName( "OPTION" );
for ( i = 0 ; i < options.getLength() ; ++i )
if ( ( (HTMLOptionElement) options.item( i ) ).getSelected() )
return i;
return -1;
|
public int | getSize()
return getInteger( getAttribute( "size" ) );
|
public int | getTabIndex()
return getInteger( getAttribute( "tabindex" ) );
|
public java.lang.String | getType()
return getAttribute( "type" );
|
public java.lang.String | getValue()
return getAttribute( "value" );
|
public void | remove(int index)
NodeList options;
Node removed;
// Use getElementsByTagName() which creates a snapshot of all the
// OPTION elements under this SELECT. Access to the returned NodeList
// is very fast and the snapshot solves many synchronization problems.
// Remove the indexed OPTION from it's parent, this might be this
// SELECT or an OPTGROUP.
options = getElementsByTagName( "OPTION" );
removed = options.item( index );
if ( removed != null )
removed.getParentNode().removeChild ( removed );
|
public void | setDisabled(boolean disabled)
setAttribute( "disabled", disabled );
|
public void | setMultiple(boolean multiple)
setAttribute( "multiple", multiple );
|
public void | setName(java.lang.String name)
setAttribute( "name", name );
|
public void | setSelectedIndex(int selectedIndex)
NodeList options;
int i;
// Use getElementsByTagName() which creates a snapshot of all the
// OPTION elements under this SELECT. Access to the returned NodeList
// is very fast and the snapshot solves many synchronization problems.
// Change the select so all OPTIONs are off, except for the
// selectIndex-th one.
options = getElementsByTagName( "OPTION" );
for ( i = 0 ; i < options.getLength() ; ++i )
( (HTMLOptionElementImpl) options.item( i ) ).setSelected( i == selectedIndex );
|
public void | setSize(int size)
setAttribute( "size", String.valueOf( size ) );
|
public void | setTabIndex(int tabIndex)
setAttribute( "tabindex", String.valueOf( tabIndex ) );
|
public void | setValue(java.lang.String value)
setAttribute( "value", value );
|