diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2017-01-05 18:09:32 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-01-05 18:09:32 +0200 |
commit | 4130f1d87d6ab387a363a4e44e8746eddc049d13 (patch) | |
tree | 0a6cb8b997f95c710dbac269bfba3615eb74df6a /documentation/components/components-combobox.asciidoc | |
parent | 11f10b827e92ed7c07d6584a181f7f1374e8109b (diff) | |
download | vaadin-framework-4130f1d87d6ab387a363a4e44e8746eddc049d13.tar.gz vaadin-framework-4130f1d87d6ab387a363a4e44e8746eddc049d13.zip |
Update component docs for 8 except Grid
Diffstat (limited to 'documentation/components/components-combobox.asciidoc')
-rw-r--r-- | documentation/components/components-combobox.asciidoc | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/documentation/components/components-combobox.asciidoc b/documentation/components/components-combobox.asciidoc index ccd75a3dc5..021d8c87a1 100644 --- a/documentation/components/components-combobox.asciidoc +++ b/documentation/components/components-combobox.asciidoc @@ -7,8 +7,6 @@ layout: page [[components.combobox]] = [classname]#ComboBox# -*_This section has not yet been updated for Vaadin Framework 8_* - ifdef::web[] [.sampler] image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/multiple-value/combo-box"] @@ -28,7 +26,7 @@ image::img/combobox-basic.png[width=35%, scaledwidth=50%] == Filtered Selection [classname]#ComboBox# allows filtering the items available for selection in the -drop-down list by the text entered in the input box. +drop-down list by the text entered in the input box. To apply custom filtering, the [methodname]#setItems(CaptionFilter, Collection)# can be used. When using a [classname]#DataProvider#, the filtering is delegated to it. [[figure.components.combobox.filter]] .Filtered Selection in [classname]#ComboBox# @@ -41,32 +39,6 @@ on the keyboard. The shown items are loaded from the server as needed, so the number of items held in the component can be quite large. The number of matching items is displayed by the drop-down list. -Filtering is enabled by setting a __filtering mode__ with -[methodname]#setFilteringMode()#. - - -[source, java] ----- -cb.setFilteringMode(FilteringMode.CONTAINS); ----- -See the http://demo.vaadin.com/book-examples-vaadin7/book#component.select.combobox.filtering[on-line example, window="_blank"]. - -The modes defined in the [classname]#FilteringMode# enum are as follows: - -[parameter]#CONTAINS#:: Matches any item that contains the string given in the text field part of the -component. - -[parameter]#STARTSWITH#:: Matches only items that begin with the given string. - -[parameter]#OFF# (default):: Filtering is by default off and all items are shown all the time. - - - -The above example uses the containment filter that matches to all items -containing the input string. As shown in <<figure.components.combobox.filter>> -below, when we type some text in the input area, the drop-down list will show -all the matching items. - [[components.combobox.newitems]] == Allowing Adding New Items @@ -91,7 +63,6 @@ List<Planet> planets = new ArrayList<>(); planets.add(new Planet(1, "Mercury")); planets.add(new Planet(2, "Venus")); planets.add(new Planet(3, "Earth")); -planets.add(new Planet(4, "Mars")); ComboBox<Planet> select = new ComboBox<>("Select or Add a Planet"); @@ -104,7 +75,6 @@ select.setItemCaptionGenerator(Planet::getName); // handling for new items select.setNewItemHandler(inputString -> { - // Create a new bean - can't set all properties Planet newPlanet = new Planet(planets.size(), inputString); planets.add(newPlanet); @@ -113,9 +83,6 @@ select.setNewItemHandler(inputString -> { // Remember to set the selection to the new item select.select(newPlanet); - - Notification.show("Added new planet called " + - inputString); }); ---- |