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/09/23 12:03:34 UTC

[empire-db] branch master updated: EMPIREDB-360 Added null value check for input and control tags

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 ac2ec6d  EMPIREDB-360 Added null value check for input and control tags
ac2ec6d is described below

commit ac2ec6db9516f55520bbc808532b4bae917b994b
Author: Rainer Döbele <do...@apache.org>
AuthorDate: Thu Sep 23 14:03:31 2021 +0200

    EMPIREDB-360
    Added null value check for input and control tags
---
 .../main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java  | 7 +++++++
 1 file changed, 7 insertions(+)

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 799a1c9..903f80c 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
@@ -786,6 +786,13 @@ public class TagEncodingHelper implements NamingContainer
             ValueExpression ve = component.getValueExpression("value");
             if (ve == null)
                 throw new PropertyReadOnlyException("value");
+            
+            if (ObjectUtils.isEmpty(value))
+            {   // check mandatory
+                Object mandatory = getTagAttributeValue("mandatory");
+                if (ObjectUtils.getBoolean(mandatory))
+                    throw new FieldNotNullException(this.column);
+            }
 
             FacesContext ctx = FacesContext.getCurrentInstance();
             ve.setValue(ctx.getELContext(), value);