com.aspose.html.forms

Class SelectElement



  • public class SelectElement
    extends FormElement<HTMLSelectElement>

    The SelectElement represents a wrapper that is associated with the HTMLSelectElement

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      String getId()
      Represents the Id attribute of the input element.
      boolean getMultiple()
      If true, multiple OPTION elements may be selected in this SELECT.
      String getName()
      Represent the name attribute of the input element.
      OptionCollection getOptions()
      Returns a list of options
      com.aspose.html.internal.ms.System.Collections.Generic.IGenericList<String> getSelectedOptions()
      Returns a list of selected options
      String getType()
      The type of this form control.
      String getValue()
      On getting, must return the value of the first option element in the list of options in tree order that has its selectedness set to true, if any.
      void selectItems(int... indexes)
      This methods allows to select multiple options by their indexes.
      void selectItems(String... values)
      This methods allows to select multiple options by their values.
      void setId(String value)
      Represents the Id attribute of the input element.
      void setMultiple(boolean value)
      If true, multiple OPTION elements may be selected in this SELECT.
      void setName(String value)
      Represent the name attribute of the input element.
      void setValue(String value)
      On getting, must return the value of the first option element in the list of options in tree order that has its selectedness set to true, if any.
      • Methods inherited from class com.aspose.html.forms.FormElementBase

        getElementType
    • Constructor Detail

      • SelectElement

        public SelectElement(HTMLSelectElement element)

        Initializes a new instance of the SelectElement class.

        Parameters:
        element - The element.
    • Method Detail

      • getValue

        public String getValue()

        On getting, must return the value of the first option element in the list of options in tree order that has its selectedness set to true, if any.

        Overrides:
        getValue in class com.aspose.html.forms.FormElementBase
      • setValue

        public void setValue(String value)

        On getting, must return the value of the first option element in the list of options in tree order that has its selectedness set to true, if any.

        Overrides:
        setValue in class com.aspose.html.forms.FormElementBase
      • getName

        public String getName()

        Represent the name attribute of the input element.

        Value: The name of the element.
        Overrides:
        getName in class com.aspose.html.forms.FormElementBase
      • setName

        public void setName(String value)

        Represent the name attribute of the input element.

        Value: The name of the element.
        Overrides:
        setName in class com.aspose.html.forms.FormElementBase
      • getId

        public String getId()

        Represents the Id attribute of the input element.

        Value: The identifier of the element.
        Overrides:
        getId in class com.aspose.html.forms.FormElementBase
      • setId

        public void setId(String value)

        Represents the Id attribute of the input element.

        Value: The identifier of the element.
        Overrides:
        setId in class com.aspose.html.forms.FormElementBase
      • getType

        public String getType()

        The type of this form control. This is the string "select-multiple" when the multiple attribute is true and the string "select-one" when false.

      • getMultiple

        public boolean getMultiple()

        If true, multiple OPTION elements may be selected in this SELECT. See the multiple attribute definition in HTML 4.01.

      • setMultiple

        public void setMultiple(boolean value)

        If true, multiple OPTION elements may be selected in this SELECT. See the multiple attribute definition in HTML 4.01.

      • getSelectedOptions

        public com.aspose.html.internal.ms.System.Collections.Generic.IGenericList<String> getSelectedOptions()

        Returns a list of selected options

      • selectItems

        public void selectItems(int... indexes)

        This methods allows to select multiple options by their indexes.

        Parameters:
        indexes - An array of indexes for parameter selection.
      • selectItems

        public void selectItems(String... values)

        This methods allows to select multiple options by their values.

        Parameters:
        values - An array of values for parameter selection.