This is an automated email from the ASF dual-hosted git repository.

doebele pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/empire-db.git


The following commit(s) were added to refs/heads/master by this push:
     new 22ff2fa  EMPIREDB-316 bugfix disabled attribute
22ff2fa is described below

commit 22ff2faf4516650eb1239c7e63665dada4aec1a4
Author: Rainer Döbele <[email protected]>
AuthorDate: Thu Oct 31 16:36:09 2019 +0100

    EMPIREDB-316
    bugfix disabled attribute
---
 .../org/apache/empire/jsf2/controls/SelectInputControl.java   |  7 ++++---
 .../java/org/apache/empire/jsf2/utils/TagEncodingHelper.java  | 11 ++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

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 b4c719e..70fae41 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
@@ -128,11 +128,12 @@ public class SelectInputControl extends InputControl
         {   // already has an empty option
             return false;
         }
+        // check required
         if (!ii.isRequired())
-        {   // check disabled and column
+        {   // check column
             Column column = ii.getColumn(); 
-            if (!(ii.isDisabled() && (column==null || 
ii.getColumn().isRequired())))
-            {
+            if (column==null || !column.isRequired())
+            {   // add empty entry
                 return true;
             }
         }
diff --git 
a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
 
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
index 6b40bea..74386ea 100644
--- 
a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
+++ 
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
@@ -336,7 +336,12 @@ public class TagEncodingHelper implements NamingContainer
         @Override
         public boolean isDisabled()
         {
-            return isReadOnly();
+            // check attribute
+            Object val = getAttributeValueEx("disabled");
+            if (val != null && ObjectUtils.getBoolean(val))
+                return true;
+            // not disabeld
+            return false;
         }
 
         @Override
@@ -831,10 +836,6 @@ public class TagEncodingHelper implements NamingContainer
 
     public boolean isReadOnly()
     {
-        // check attribute
-        Object val = getAttributeValueEx("disabled");
-        if (val != null && ObjectUtils.getBoolean(val))
-            return true;
         // Check Record
         if (isRecordReadOnly())
             return true;

Reply via email to