You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/10/29 17:30:11 UTC

(ofbiz-framework) branch release24.09 updated: Keep the ignore-when of form fields inherited through form extends

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

mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 60aa118f71 Keep the ignore-when of form fields inherited through form extends
60aa118f71 is described below

commit 60aa118f71dbb170f520ace3a7e1ec0680b49eb2
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Thu Oct 29 20:23:22 2026 +0530

    Keep the ignore-when of form fields inherited through form extends
    
    Neither copy constructor of ModelFormFieldBuilder copied ignoreWhen, so a field inherited through form extends, or copied from another builder, lost its ignore-when condition and was always rendered. Both constructors now copy it, using a new ModelFormField.getIgnoreWhen() getter that returns the expression like getUseWhen() does.
---
 .../src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java   | 4 ++++
 .../java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java     | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
index 5936049381..56ef1d8639 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
@@ -751,6 +751,10 @@ public final class ModelFormField {
         return "";
     }
 
+    public FlexibleStringExpander getIgnoreWhen() {
+        return ignoreWhen;
+    }
+
     public String getIgnoreWhen(Map<String, Object> context) {
         if (UtilValidate.isNotEmpty(this.ignoreWhen)) {
             return this.ignoreWhen.expandString(context);
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
index 9647fa9641..afd1a4de40 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java
@@ -295,6 +295,7 @@ public class ModelFormFieldBuilder {
         this.headerLink = modelFormField.getHeaderLink();
         this.headerLinkStyle = modelFormField.getHeaderLinkStyle();
         this.idName = modelFormField.getIdName();
+        this.ignoreWhen = modelFormField.getIgnoreWhen();
         this.mapAcsr = modelFormField.getMapAcsr();
         this.modelForm = modelFormField.getModelForm();
         this.name = modelFormField.getName();
@@ -338,6 +339,7 @@ public class ModelFormFieldBuilder {
         this.headerLink = builder.getHeaderLink();
         this.headerLinkStyle = builder.getHeaderLinkStyle();
         this.idName = builder.getIdName();
+        this.ignoreWhen = builder.getIgnoreWhen();
         this.mapAcsr = builder.getMapAcsr();
         this.modelForm = builder.getModelForm();
         this.name = builder.getName();