From 9ef479303bb514622ef90d95b94d912780c1812d Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 27 Jan 2017 15:44:03 +0200 Subject: Introduce empty selection functionality for NativeSelect. (#8336) * Introduce empty selection functionality for NativeSelect. Fixes vaadin/framework8-issues#545 --- .../com/vaadin/shared/ui/nativeselect/NativeSelectState.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'shared/src/main/java') 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; } -- cgit v1.2.3