Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9AFD200CD0 for ; Tue, 25 Jul 2017 21:43:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A82F216762F; Tue, 25 Jul 2017 19:43:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EE88D16762D for ; Tue, 25 Jul 2017 21:43:04 +0200 (CEST) Received: (qmail 57365 invoked by uid 500); 25 Jul 2017 19:43:04 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 57352 invoked by uid 99); 25 Jul 2017 19:43:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2017 19:43:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 40281C00A9 for ; Tue, 25 Jul 2017 19:43:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.718 X-Spam-Level: * X-Spam-Status: No, score=1.718 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 9U3nHI7uR6CQ for ; Tue, 25 Jul 2017 19:43:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DEF2E5F6BE for ; Tue, 25 Jul 2017 19:43:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 12F04E0E29 for ; Tue, 25 Jul 2017 19:43:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6990423F3E for ; Tue, 25 Jul 2017 19:43:00 +0000 (UTC) Date: Tue, 25 Jul 2017 19:43:00 +0000 (UTC) From: "Bill Lucy (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-3525) javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL value affects display behavior for required fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 25 Jul 2017 19:43:05 -0000 [ https://issues.apache.org/jira/browse/MYFACES-3525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16100634#comment-16100634 ] Bill Lucy commented on MYFACES-3525: ------------------------------------ Would you mind attaching a patch here or on the dev list so I can make sure I understand your proposal? > javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL value affects display behavior for required fields > -------------------------------------------------------------------------------------------------------------- > > Key: MYFACES-3525 > URL: https://issues.apache.org/jira/browse/MYFACES-3525 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.0.12 > Reporter: VS > Assignee: Bill Lucy > Fix For: 2.0.25-SNAPSHOT, 2.1.19-SNAPSHOT, 2.2.13-SNAPSHOT > > Attachments: MYFACES-3525.patch > > > Inconsistent behavior for required field validation when javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is set to true versus false > To observe behavior: > 1. Set javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL to true in web.xml > 2. Create JSF Page: > > > required="true" > requiredMessage="You must enter a first name"/> > > > 3. Create Managed Bean: > @ManagedBean > public class Page1Controller > { > public String getFirstName() > { return "Default Value"; } > public void setFirstName(String value) > { // no-op (for example purposes only) } > 4. Load JSF page, blank out value in the input field and click Submit > 5. Error message is displayed, however the value in the input field (which you formerly blanked out) is now reset back to its original value. > 6. Change the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL setting to false and re-run the test. > 7. Note that the value in the input field remains blank. > Behavior is inconsistent and should be fixed (javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL setting of true or false should not result in inconsistent behavior with required fields) > ---- > To state in a different way: > When INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is TRUE, and you blank out a value for a required field that had previously been populated by the model, submit the form, you will see the OLD data from the model in the field. However, if that field had had a format validation applied to it and the user submits the form with a format validation error, the OLD data is NOT shown in the field (instead, the submitted/invalid data is shown). The same should happen for required field validation errors. The field should show the "blank" data and not the original model data. In order to get the correct behavior, the developer has to currently set INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL to false. But they should not have to do this... whether INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is true or false, the behavior of showing the blank field that the user submitted should be the same. -- This message was sent by Atlassian JIRA (v6.4.14#64029)