Return-Path: X-Original-To: apmail-ofbiz-commits-archive@www.apache.org Delivered-To: apmail-ofbiz-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF28E10AFC for ; Tue, 4 Mar 2014 10:38:41 +0000 (UTC) Received: (qmail 46213 invoked by uid 500); 4 Mar 2014 10:38:41 -0000 Delivered-To: apmail-ofbiz-commits-archive@ofbiz.apache.org Received: (qmail 46184 invoked by uid 500); 4 Mar 2014 10:38:40 -0000 Mailing-List: contact commits-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list commits@ofbiz.apache.org Received: (qmail 46174 invoked by uid 99); 4 Mar 2014 10:38:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 10:38:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 10:38:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 270A023889FA; Tue, 4 Mar 2014 10:38:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1574022 - in /ofbiz/branches/release11.04: ./ framework/widget/src/org/ofbiz/widget/form/ModelForm.java Date: Tue, 04 Mar 2014 10:38:19 -0000 To: commits@ofbiz.apache.org From: jleroux@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140304103819.270A023889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jleroux Date: Tue Mar 4 10:38:18 2014 New Revision: 1574022 URL: http://svn.apache.org/r1574022 Log: "Applied fix from trunk for revision: 1574019 " ------------------------------------------------------------------------ r1574019 | jleroux | 2014-03-04 11:37:01 +0100 (mar. 04 mars 2014) | 16 lignes 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 jleroux: this second version works correctly ------------------------------------------------------------------------  Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1574019 Modified: ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=1574022&r1=1574021&r2=1574022&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original) +++ ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Tue Mar 4 10:38:18 2014 @@ -999,6 +999,9 @@ public class ModelForm extends ModelWidg } //Debug.logInfo("In single form evaluating use-when for field " + currentFormField.getName() + ": " + currentFormField.getUseWhen(), module); if (!currentFormField.shouldUse(context)) { + if (UtilValidate.isNotEmpty(lastFormField)) { + currentFormField = lastFormField; + } continue; } alreadyRendered.add(currentFormField.getName());