You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2022/02/03 10:26:42 UTC
[ofbiz-framework] branch release18.12 updated: Fixed: Attribute default-field-type hidden doesn't work for auto-fields-service element (OFBIZ-12555)
This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push:
new fb95c79 Fixed: Attribute default-field-type hidden doesn't work for auto-fields-service element (OFBIZ-12555)
fb95c79 is described below
commit fb95c796bb884fb6e2262ccad8ac821dc64b89e7
Author: Nicolas Malin <ni...@nereide.fr>
AuthorDate: Wed Feb 2 18:07:37 2022 +0100
Fixed: Attribute default-field-type hidden doesn't work for auto-fields-service element (OFBIZ-12555)
When you define a widget form and wish populate hidden fields with the element auto-fields-service, OFBiz rendering each as edit field type.
<form name="ListPartyQuals" ...>
<auto-fields-service service-name="updatePartyQual" default-field-type="hidden"/>
</form>
The problem came from the function ModelFormFieldBuilder.induceFieldInfoFromServiceParam didn't manage the case "hidden"
---
.../main/java/org/apache/ofbiz/widget/model/ModelFormFieldBuilder.java | 3 +++
1 file changed, 3 insertions(+)
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 ef678c8..398c97f 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
@@ -673,6 +673,9 @@ public class ModelFormFieldBuilder {
} else if ("display".equals(defaultFieldType)) {
ModelFormField.DisplayField displayField = new ModelFormField.DisplayField(FieldInfo.SOURCE_AUTO_SERVICE, null);
this.setFieldInfo(displayField);
+ } else if ("hidden".equals(defaultFieldType)) {
+ ModelFormField.HiddenField hiddenField = new ModelFormField.HiddenField(FieldInfo.SOURCE_AUTO_SERVICE, null);
+ this.setFieldInfo(hiddenField);
} else {
// default to "edit"
if (modelParam.type.indexOf("Double") != -1 || modelParam.type.indexOf("Float") != -1