You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2021/05/12 16:52:53 UTC

[empire-db] branch master updated: EMPIREDB-348 check before isFieldReadOnly

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 598dc64  EMPIREDB-348 check before isFieldReadOnly
598dc64 is described below

commit 598dc64d1a476e1a91d40c584a00aa73403923b6
Author: Rainer Döbele <do...@apache.org>
AuthorDate: Wed May 12 18:52:48 2021 +0200

    EMPIREDB-348
    check before isFieldReadOnly
---
 .../src/main/webapp/css/content.css                      |  1 +
 .../org/apache/empire/jsf2/utils/TagEncodingHelper.java  | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css b/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
index bbd719e..c42ec33 100644
--- a/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
+++ b/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
@@ -98,6 +98,7 @@ input[type=text].eInpReq {
 	border: 1px brown solid;
 }
 select.eInpDis, 
+textarea.eInpDis,
 input[type=text].eInpDis {
 	border: 1px #C0C0C0 solid;
 	color: #808080;
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 3c52da4..799a1c9 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
@@ -796,9 +796,14 @@ public class TagEncodingHelper implements NamingContainer
     {
         return isReadOnly();
     }
-    
+
     public boolean isRecordReadOnly()
     {
+        return (getRecordReadOnly()==Boolean.TRUE);
+    }
+    
+    public Boolean getRecordReadOnly()
+    {
         // Do we have a record?
         if (getRecord() instanceof RecordData)
         {   // Only a RecordData?
@@ -821,8 +826,8 @@ public class TagEncodingHelper implements NamingContainer
         // Do we have a record?
         if ((record instanceof Record) && ((Record)record).isReadOnly())
             return true;
-        // column
-        return false;
+        // not defined
+        return null;
     }
 
     public boolean isVisible()
@@ -855,8 +860,9 @@ public class TagEncodingHelper implements NamingContainer
             return true;
         }
         // Check Record
-        if (isRecordReadOnly())
-            return true;
+        Boolean readOnly = getRecordReadOnly();
+        if (readOnly!=null)
+            return readOnly;
         // Check Record
         if ((getRecord() instanceof Record))
         { // Ask Record