summaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorDenis <denis@vaadin.com>2017-01-27 15:44:03 +0200
committerGitHub <noreply@github.com>2017-01-27 15:44:03 +0200
commit9ef479303bb514622ef90d95b94d912780c1812d (patch)
treefd6929a4b396cb6b1ff290ded4e129cd60415d60 /shared/src
parent5616216306a138b3437d188e4b2df8253590abf5 (diff)
downloadvaadin-framework-9ef479303bb514622ef90d95b94d912780c1812d.tar.gz
vaadin-framework-9ef479303bb514622ef90d95b94d912780c1812d.zip
Introduce empty selection functionality for NativeSelect. (#8336)
* Introduce empty selection functionality for NativeSelect. Fixes vaadin/framework8-issues#545
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/nativeselect/NativeSelectState.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/nativeselect/NativeSelectState.java b/shared/src/main/java/com/vaadin/shared/ui/nativeselect/NativeSelectState.java
index e4ff336e4d..c33cc66f82 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/nativeselect/NativeSelectState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/nativeselect/NativeSelectState.java
@@ -31,6 +31,18 @@ public class NativeSelectState extends AbstractSingleSelectState {
*/
public static final String STYLE_NAME = "v-select";
+ /**
+ * True to allow selecting nothing (a special empty selection item is shown
+ * at the beginning of the list), false not to allow empty selection by the
+ * user.
+ */
+ public boolean emptySelectionAllowed = true;
+
+ /**
+ * Caption for item which represents empty selection.
+ */
+ public String emptySelectionCaption = "";
+
{
primaryStyleName = STYLE_NAME;
}