Class Select
The select element represents a control that provides a menu of options. It creates a dropdown list that allows users to select one or more options from a list. The select element contains option elements that define the available choices, and can be organized into groups using optgroup elements.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.bean.html5.HtmlElementContainer
child, children, getChild, getChild, getChild, getChildren, setChildrenMethods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
Select
public Select()Creates an emptySelectelement. -
Select
Creates aSelectelement with the specifiedname(String)attribute and child nodes.- Parameters:
name- Thename(String)attribute. Can benull to unset the attribute.children- The child nodes. Must not benull .
-
-
Method Details
-
autofocus
autofocus attribute.Automatically focus the form control when the page is loaded.
-
choose
Convenience method for selecting a childOptionafter the options have already been populated.- Parameters:
optionValue- The option value. Can benull (no-op; no option is selected).- Returns:
- This object.
-
disabled
disabled attribute.Whether the form control is disabled.
This attribute uses deminimized values:
false - Attribute is not addedtrue - Attribute is added as"disabled" - Other values - Passed through as-is
-
form
form attribute.Associates the select element with a form element by specifying the form's ID. This allows the select to be placed outside the form element while still being part of the form.
The value should match the ID of a form element in the same document.
- Parameters:
value- The ID of the form element to associate with this select. Can benull to unset the attribute.- Returns:
- This object.
-
multiple
multiple attribute.Whether to allow multiple values.
This attribute uses deminimized values:
false - Attribute is not addedtrue - Attribute is added as"multiple" - Other values - Passed through as-is
-
name
name attribute.Specifies the name of the select element. This name is used when the form is submitted and can be used to access the element via the form.elements API.
The name should be unique within the form and should not contain spaces or special characters.
- Parameters:
value- The name of the select element for submission and API access. Can benull to unset the attribute.- Returns:
- This object.
-
required
required attribute.Whether the control is required for form submission.
-
size
size attribute.Specifies the number of visible options in a select element. If greater than 1, the select becomes a scrollable list instead of a dropdown.
- Parameters:
value- The number of visible options (1 for dropdown, >1 for list). Can benull to unset the attribute.- Returns:
- This object.
-