Class Select


@Bean(typeName="select") public class Select extends HtmlElementContainer
DTO for an HTML <select> element.

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:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple select dropdown Select select1 = select("color", option("red", "Red"), option("green", "Green"), option("blue", "Blue") ); // Multiple selection Select select2 = select("hobbies", option("reading", "Reading"), option("gaming", "Gaming"), option("sports", "Sports") ).multiple(true).size(4); // Select with option groups Select select3 = select("food", optgroup("Fruits", option("apple", "Apple"), option("banana", "Banana") ), optgroup("Vegetables", option("carrot", "Carrot"), option("broccoli", "Broccoli") ) ); // Disabled select Select select4 = select("disabled") .disabled(true) .children( option().value("option1").text("Option 1") );

The following convenience methods are provided for constructing instances of this bean:

See Also: