empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject empire-db git commit: EMPIREDB-232 fixed empty select option problem
Date Mon, 21 Mar 2016 13:07:55 GMT
Repository: empire-db
Updated Branches:
  refs/heads/master 911dc38c1 -> 6580f386e


EMPIREDB-232
fixed empty select option problem

Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo
Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/6580f386
Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/6580f386
Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/6580f386

Branch: refs/heads/master
Commit: 6580f386e640c8d86a4d427ca6ac8aea1eef3634
Parents: 911dc38
Author: Rainer Döbele <doebele@apache.org>
Authored: Mon Mar 21 14:07:48 2016 +0100
Committer: Rainer Döbele <doebele@apache.org>
Committed: Mon Mar 21 14:07:48 2016 +0100

----------------------------------------------------------------------
 .../empire/jsf2/controls/SelectInputControl.java    | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/empire-db/blob/6580f386/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
----------------------------------------------------------------------
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
index 425cdc7..9d3e818 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/SelectInputControl.java
@@ -113,9 +113,19 @@ public class SelectInputControl extends InputControl
         input.setDisabled(disabled);
         // Options (sync)
         Options options = ii.getOptions();
-        boolean addEmpty = getEmptyEntryRequired(ii, disabled) && !options.contains("");
-        String nullText = (addEmpty) ? getNullText(ii) : "";
-        syncOptions(input, ii.getTextResolver(), options, addEmpty, nullText, ii.isInsideUIData());
+        if (options!=null)
+        {   // syncOptions
+            boolean addEmpty = getEmptyEntryRequired(ii, disabled) && !options.contains("");
+            String nullText = (addEmpty) ? getNullText(ii) : "";
+            syncOptions(input, ii.getTextResolver(), options, addEmpty, nullText, ii.isInsideUIData());
+        }
+        else
+        {   // clear or not?
+            if (ii.getValue(false)!=null)
+                log.warn("No options have been set for column {}", ii.getColumn().getName());
+            else
+                input.getChildren().clear();
+        }
         // set value
         if (setValue)
         {   // style


Mime
View raw message