aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>2008-06-14 18:31:49 +0000
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>2008-06-14 18:31:49 +0000
commit044e2f6fc59fdaf3df3f4f54361d19c634fafecf (patch)
tree14aca3a4b73deae3eec15cd72580f5d2b5c396bf
parent2109b04d91a92d8d68ed9388c2f95b5770e00ca4 (diff)
downloadvaadin-framework-044e2f6fc59fdaf3df3f4f54361d19c634fafecf.tar.gz
vaadin-framework-044e2f6fc59fdaf3df3f4f54361d19c634fafecf.zip
Fixes #1819 : Selection with null-not allowed, but with null selected does not immediately remove null selection possibility when selected
svn changeset:4885/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/ui/Select.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/itmill/toolkit/ui/Select.java b/src/com/itmill/toolkit/ui/Select.java
index 5b33aadd5c..3c769912ba 100644
--- a/src/com/itmill/toolkit/ui/Select.java
+++ b/src/com/itmill/toolkit/ui/Select.java
@@ -169,8 +169,14 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering {
while (i.hasNext()) {
- // Gets the option attribute values
final Object id = i.next();
+
+ if (!isNullSelectionAllowed() && id != null
+ && id.equals(getNullSelectionItemId()) && !isSelected(id)) {
+ continue;
+ }
+
+ // Gets the option attribute values
final String key = itemIdMapper.key(id);
final String caption = getItemCaption(id);
final Resource icon = getItemIcon(id);