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 8b6ea38b EMPIREDB-407 Add format option "nounit" to suppress unit 
rendering
8b6ea38b is described below

commit 8b6ea38b8be0830fd61a1e7e6f2f250ec09f3036
Author: Rainer Döbele <[email protected]>
AuthorDate: Tue Mar 28 15:56:16 2023 +0200

    EMPIREDB-407
    Add format option "nounit" to suppress unit rendering
---
 .../main/java/org/apache/empire/jsf2/controls/TextInputControl.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
 
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
index f440f507..c9f7246b 100644
--- 
a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
+++ 
b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/controls/TextInputControl.java
@@ -100,7 +100,7 @@ public class TextInputControl extends InputControl
         compList.add(input);
         // add unit
         String unit = getUnitString(ii);
-        if (StringUtils.isNotEmpty(unit))
+        if (StringUtils.isNotEmpty(unit) && !hasFormatOption(ii, "nounit"))
         {   // add the unit
             compList.add(createUnitLabel(TagStyleClass.UNIT.get(), ii, unit));
         }
@@ -170,6 +170,7 @@ public class TextInputControl extends InputControl
         */
         span.getAttributes().put("styleClass", tagStyle);
         span.getChildren().add(text);
+        // done 
         return span;
     }
 
@@ -367,7 +368,7 @@ public class TextInputControl extends InputControl
         writer.append(text);
         // unit?
         String unit = getUnitString(vi);
-        if (StringUtils.isNotEmpty(unit))
+        if (StringUtils.isNotEmpty(unit) && !hasFormatOption(vi, "nounit"))
         { // append unit
             writer.append(" ");
             writer.append(unit);

Reply via email to