« Previous | Next » 

Revision c2abfe97

IDc2abfe9741517bbb6a416bc26f4fa733fde50720
Parent 8c3363ee
Child ad7c7060

Added by Bastian Waidelich almost 7 years ago

[!!!][BUGFIX] Submitted form data has precedence over value argument

This adjusts the behavior of all Form ViewHelpers so that any
submitted value is redisplayed even if a "value" argument has been
specified.

Being able to specify the "value" argument in Form ViewHelpers is a
good way to pre-format the initial value::

<f:form.textfield property="price"
value="{product.price -> f:format.number()}" />

The issue with this, however, was that upon re-display of the form due
to property-mapping or validation errors the value argument had
precedence over the previously submitted value.

This is a breaking change if you expect the previous behavior of form
ViewHelpers always being pre-populated with the specified value
attribute / bound object property even when re-displaying the form upon
validation errors.
Besides this change deprecates
``AbstractFormFieldViewHelper::getValue()``. If you call that method in
your custom ViewHelpers you should use
``AbstractFormFieldViewHelper::getValueAttribute()`` instead and call
``AbstractFormFieldViewHelper::addAdditionalIdentityPropertiesIfNeeded()``
explicitly if the ViewHelper might be bound to (sub)entities.

Change-Id: I80e7e664e7a1fa41dc36bdf89e331086c6815f78
Fixes: FLOW-213
Releases: master

  • added
  • modified
  • copied
  • renamed
  • deleted