You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

components-nativeselect.asciidoc 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. title: NativeSelect
  3. order: 18
  4. layout: page
  5. ---
  6. [[components.nativeselect]]
  7. = NativeSelect
  8. ifdef::web[]
  9. [.sampler]
  10. image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/multiple-value/drop-down-menu"]
  11. endif::web[]
  12. [classname]#NativeSelect# is a selection component allows selecting an item from a
  13. drop-down list. It is implemented with the native selection input of web browsers, using the HTML [literal]#++<select>++# element.
  14. [source, java]
  15. ----
  16. // Create the selection component
  17. NativeSelect<String> select =
  18. new NativeSelect<>("Native Selection");
  19. // Add some items
  20. select.setItems("Mercury", "Venus", ...);
  21. ----
  22. The [methodname]#setColumns()# allows setting the width of the list as
  23. "columns", which is a measure that depends on the browser.
  24. [[figure.components.nativeselect.basic]]
  25. .The [classname]#NativeSelect# Component
  26. image::img/nativeselect-basic.png[width=20%, scaledwidth=35%]
  27. Common selection component features are described in
  28. <<dummy/../../../framework/components/components-selection#components.selection,"Selection Components">>.
  29. == CSS Style Rules
  30. [source, css]
  31. ----
  32. .v-select {}
  33. .v-select-select {}
  34. ----
  35. The component has a [literal]#++v-select++# overall style. The native
  36. [literal]#++select++# element has [literal]#++v-select-select++# style.