Project

General

Profile

Actions

Bug #66688

closed

Story #69712: Further FormEngine development

FormEngine: returnFieldJS() for type=text eval not implemented

Added by Christian Kuhn almost 9 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2015-04-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

It is documented in TCA reference that type=text can be eval'd with returnFieldJS, but that is not implemented.

A section similar to this is missing in TextElement:

                // Going through all custom evaluations configured for this field
                foreach ($evalList as $evalData) {
                    $evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData] . ':&' . $evalData);
                    if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
                        $resultArray['extJSCODE'] .= LF . 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($evalData) . '] = function(value) {' . $evalObj->returnFieldJS() . '}';
                        $paramsList = GeneralUtility::quoteJSvalue($parameterArray['itemFormElName']) . ',' . GeneralUtility::quoteJSvalue($evalData) . ',' . GeneralUtility::quoteJSvalue(trim($config['is_in'])) . ',' . ($config['checkbox'] ? 1 : 0) . ',' . GeneralUtility::quoteJSvalue($config['checkbox']);
                        $parameterArray['fieldChangeFunc'] = array_merge(array('typo3form.fieldGet' => 'typo3form.fieldGet(' . $paramsList . ');'), $parameterArray['fieldChangeFunc']);
                    }
                }

This does not work since fieldGet JS works on _hr input names, which is not done for type=text, but for type=input only ...

This issue could be solved if the _hr fieldname madness is solved.

ext:styleguide has examples for this in input_21 and type_9

Also, the documentation should be improved and namespaced, and the tx_ prefix is not required anymore, see the two styleguide fields for examples.

http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Text/Index.html#eval


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Epic #63846: Refactoring of form element classesClosedFrank Nägler2014-12-14

Actions
Related to TYPO3 Core - Bug #61370: Missing feature with eval user functionClosed2014-09-05

Actions
Actions

Also available in: Atom PDF