« Previous | Next » 

Revision 516fc370

Parent b7c8a292

Added by Alexander Berl over 8 years ago

[BUGFIX] Additional Identity Properties not set on mapping error

When binding Fluid forms to nested objects, Fluid automatically adds
hidden fields with the identifiers of all affected objects so that
the persistence layer can update all objects correctly.

When a form was redisplayed due to property mapping errors, the
identity fields for the nested sub objects were no longer created.

This change fixes this by making sure all identity fields are rendered
recursively also after property mapping errors.

Example code to verify this::

<f:form action="update" object="{user}" objectName="user">
<f:form.textfield property="firstName" />
<f:for each="{user.invoices}" as="invoice" iteration="iteration"> {iteration.cycle}:
<f:form.textfield property="invoices.{iteration.index}.subject" />
<f:form.submit value="update" />

When submitting the form with validation errors, the redisplayed form
should contain a div with a hidden field named
"user[__identity]" for the user and one for each invoice.

Change-Id: I3debbc135d31278e91b83b3ac375bd5f62d13923
Fixes: #29290
Releases: master, 2.0

  • added
  • modified
  • copied
  • renamed
  • deleted