From d79ae78453cd89cdca7b6c11dce4bf0aaf7915fd Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Sat, 1 Mar 2014 12:15:33 +0000 Subject: [PATCH] A patch from Leila Mekika for "Problems in single form when use-when and position are used together" https://issues.apache.org/jira/browse/OFBIZ-5552 The service "renderSingleFormString" check the previous field position to see if the current field must be displayed after the previous field or on a new line. When the previous field has a use-when condition that is not valid, it remains as the currentFormField and the next field is compared with this "not rendered" field. If the position of this previous field is the same as the current field, the current is displayed on the next line. To reproduce, add in a single form the three fields below : The field second is rendered on a new line git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1573161 13f79535-47bb-0310-9956-ffa450edef68 --- framework/widget/src/org/ofbiz/widget/form/ModelForm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java index c77f5ca0cf..c4c226b616 100644 --- a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java +++ b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java @@ -1062,6 +1062,7 @@ public class ModelForm extends ModelWidget { } //Debug.logInfo("In single form evaluating use-when for field " + currentFormField.getName() + ": " + currentFormField.getUseWhen(), module); if (!currentFormField.shouldUse(context)) { + currentFormField = lastFormField; continue; } alreadyRendered.add(currentFormField.getName());