[
https://issues.apache.org/jira/browse/CLK-643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846325#action_12846325
]
Bob Schellink commented on CLK-643:
-----------------------------------
Would one really need both properties? Perhaps a noCopy property is enough? A
related issue is about having immutable controls so that once the value is set,
it cannot be altered. I normally create an ImmutableHiddenField for this
purpose, but might be useful for other fields as well.
> 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.