Task #95278
Updated by Oliver Hader almost 3 years ago
ModuleTemplate components API allows to use @onclick@ event attributes containing inline JavaScript. Capabilities have been introduced with #69814 (https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/7.6/Feature-69814-ModuleTemplateAPI.html).
Corresponding @onclick@ functionality will be deprecated and removed in TYPO3 v12.0 - this particular functionality is not used by the TYPO3 core at all, but is used by several extensions. The scope of this task is to provide some good examples concerning potential migration.
<pre>
// this shall be deprecated and avoided
$viewButton = $buttonBar->makeLinkButton()
->setOnClick(...);
</pre>
Usages in (some) extensions:
* https://github.com/jweiland-net/jwtools2/blob/master/Classes/Backend/SolrDocHeader.php#L46-L63
* https://github.com/FriendsOfTYPO3/rtehtmlarea/blob/master/Classes/Controller/Wizard/RteController.php#L277-L294
* https://bitbucket.org/ArminVieweg/dce/src/c6d9dfcd050e175e5d1172077910e31cc9baf3e8/Classes/Hooks/DocHeaderButtonsHook.php#lines-46:49
* https://github.com/liayn/t3ext-wizard_crpagetree/blob/master/Classes/NewPagetreeController.php#L77-L81
* https://github.com/georgringer/news/blob/master/Classes/Controller/AdministrationController.php#L251-L260
* https://github.com/pluspol-interactive/templavoilaplus/blob/master/Classes/Controller/Backend/PageLayoutController.php#L493-L497