From: Ralf Zimmermann Date: Fri, 29 Sep 2017 11:32:16 +0000 (+0200) Subject: [TASK] EXT:form - explain initializeFormElement hook X-Git-Tag: v9.0.0~454 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/2a65199aae9d8f5c1c969ee5565fce4d6cbcbf19?hp=c24425a42495c4840f32ac3c90363f05ad7ba231 [TASK] EXT:form - explain initializeFormElement hook Add more explanations about the initializeFormElement hook into the docs. Resolves: #82615 Releases: master, 8.7 Change-Id: I670625533f95b92a37f5536096eb2cc4211d33d9 Reviewed-on: https://review.typo3.org/54234 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- diff --git a/typo3/sysext/form/Documentation/ApiReference/Index.rst b/typo3/sysext/form/Documentation/ApiReference/Index.rst index e025dbd9c249..747ff7637317 100644 --- a/typo3/sysext/form/Documentation/ApiReference/Index.rst +++ b/typo3/sysext/form/Documentation/ApiReference/Index.rst @@ -1499,6 +1499,10 @@ initializeFormElement You can connect to the hook and initialize a form elements without defining a custom implementaion to access the element's ``initializeFormElement`` method. You only need a class which connects to this hook. Then detect the form element you wish to initialize. You can use this hook to prefill form element data for example from database tables. +Note that this hook will be called **after** all properties from the prototype configuration are set in the form element but **before** the properties from +the form definition are set in the form element. +If you want to prefill form element data after the complete form element is configured you should use the :ref:`afterBuildingFinished` hook. + This hook is invoked by the methods ``TYPO3\CMS\Form\Domain\Model\FormElements\Page::createElement()`` and ``TYPO3\CMS\Form\Domain\Model\FormElements\Section::createElement()``. That means the hook will **not** be triggered for ``Pages``.