aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Select.java
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2010-05-27 10:54:52 +0000
committerHenri Sara <henri.sara@itmill.com>2010-05-27 10:54:52 +0000
commit3051f78452bc7687da48400d670f9baefa1ed1b0 (patch)
treedc42093a1d91414b179c3d26f0c994bc12ed20fd /src/com/vaadin/ui/Select.java
parent327bf1d1c711941a7bf360fe7d8eb79be7e9f8c1 (diff)
downloadvaadin-framework-3051f78452bc7687da48400d670f9baefa1ed1b0.tar.gz
vaadin-framework-3051f78452bc7687da48400d670f9baefa1ed1b0.zip
#5053 and #5083: Last ComboBox item may not be shown if null selection enabled, incorrect display of filtered items when null selection is allowed
svn changeset:13393/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/ui/Select.java')
-rw-r--r--src/com/vaadin/ui/Select.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java
index 467a21b259..0f33529714 100644
--- a/src/com/vaadin/ui/Select.java
+++ b/src/com/vaadin/ui/Select.java
@@ -165,11 +165,14 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
}
List options = getFilteredOptions();
- options = sanitetizeList(options, needNullSelectOption);
+ boolean nullFilteredOut = filterstring != null
+ && !"".equals(filterstring)
+ && filteringMode != FILTERINGMODE_OFF;
+ options = sanitetizeList(options, needNullSelectOption
+ && !nullFilteredOut);
final boolean paintNullSelection = needNullSelectOption
- && (currentPage == 0 && (getFilteringMode() == FILTERINGMODE_OFF
- || filterstring == null || filterstring.equals("")));
+ && currentPage == 0 && !nullFilteredOut;
if (paintNullSelection) {
target.startTag("so");
@@ -218,7 +221,7 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
+ (needNullSelectOption ? 1 : 0));
if (filteredOptions != null) {
target.addAttribute("totalMatches", filteredOptions.size()
- + (needNullSelectOption ? 1 : 0));
+ + (needNullSelectOption && !nullFilteredOut ? 1 : 0));
}
// Paint variables