Return-Path: Delivered-To: apmail-click-dev-archive@www.apache.org Received: (qmail 57066 invoked from network); 14 Mar 2010 07:38:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Mar 2010 07:38:34 -0000 Received: (qmail 16776 invoked by uid 500); 14 Mar 2010 07:37:51 -0000 Delivered-To: apmail-click-dev-archive@click.apache.org Received: (qmail 16697 invoked by uid 500); 14 Mar 2010 07:37:51 -0000 Mailing-List: contact dev-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@click.apache.org Delivered-To: mailing list dev@click.apache.org Received: (qmail 16682 invoked by uid 99); 14 Mar 2010 07:37:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Mar 2010 07:37:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Mar 2010 07:37:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 42C36234C052 for ; Sun, 14 Mar 2010 07:37:27 +0000 (UTC) Message-ID: <1584506840.252971268552247272.JavaMail.jira@brutus.apache.org> Date: Sun, 14 Mar 2010 07:37:27 +0000 (UTC) From: "Bob Schellink (JIRA)" To: dev@click.apache.org Subject: [jira] Commented: (CLK-643) Form copy to object behaviour In-Reply-To: <145189955.244271268479827240.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLK-643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845044#action_12845044 ] Bob Schellink commented on CLK-643: ----------------------------------- Having Form properties to override defaults could be useful, but an intuitive default will be good. According to the spec, the disabled attribute was meant to be used in the context of JavaScript, so catering for this use case make sense. I have a feeling that disabled usage is underutilized because of its strange behavior. > Form copy to object behaviour > ----------------------------- > > Key: CLK-643 > URL: https://issues.apache.org/jira/browse/CLK-643 > Project: Click > Issue Type: Improvement > Components: core > Affects Versions: 2.1.0 > Reporter: Malcolm Edgar > Assignee: Malcolm Edgar > Priority: Minor > Fix For: 2.2.0 > > > The Form#copyFormToObject() behaviour can be misleading in two respects. > When a HTML forms field is disabled, its value is displayed in the browser window but it is not editable and is disable. However when the user submits the form the field value is not submitted even if it is populated. The Form#copyFormToObject() method will actually nullify the target objects property value, as the disabled field has a null value. This is clearly not the expected behaviour. > The other scenario which is problematic is with readonly fields. By default the Form#copyFormToObject() method will write read only field value into the target objects properties. Sometimes this is not the behaviour you are after, as type coercion behaviour cause errors. For example if you are using a form which has some TextFields showin a date property as a readonly field, when the form is submitted the string value will be set on the target objects property which will cause type coercion issues, or may truncate data. The Form should have an option to not write readonly field values when copying form field values to a target object. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.