Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

components-listselect.asciidoc 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ---
  2. title: ListSelect
  3. order: 17
  4. layout: page
  5. ---
  6. [[components.listselect]]
  7. = [classname]#ListSelect#
  8. ifdef::web[]
  9. [.sampler]
  10. image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/multiple-value/list-select"]
  11. endif::web[]
  12. The [classname]#ListSelect# component is list box that shows the selectable
  13. items in a vertical list. If the number of items exceeds the height of the
  14. component, a scrollbar is shown. The component allows both single and multiple
  15. selection modes, which you can set with [methodname]#setMultiSelect()#. It is
  16. visually identical in both modes.
  17. [source, java]
  18. ----
  19. // Create the selection component
  20. ListSelect select = new ListSelect("The List");
  21. // Add some items (here by the item ID as the caption)
  22. select.addItems("Mercury", "Venus", "Earth", ...);
  23. select.setNullSelectionAllowed(false);
  24. // Show 5 items and a scrollbar if there are more
  25. select.setRows(5);
  26. ----
  27. The number of visible items is set with [methodname]#setRows()#.
  28. [[figure.components.listselect.basic]]
  29. .The [classname]#ListSelect# Component
  30. image::img/listselect-basic.png[width=35%, scaledwidth=50%]
  31. Common selection component features are described in
  32. <<dummy/../../../framework/components/components-selection#components.selection,"Selection Components">>.
  33. == CSS Style Rules
  34. [source, css]
  35. ----
  36. .v-select {}
  37. .v-select-select {}
  38. option {}
  39. ----
  40. The component has an overall [literal]#++v-select++# style. The native
  41. [literal]#++<select>++# element has [literal]#++v-select-select++# style. The
  42. items are represented as [literal]#++<option>++# elements.