01. 02. 2016, 15:14
Hallo Leute, ich habe von der TYPO3-Seite folgenden Code gefunden, der mir sehr weiterhelfen könnte, wenn er funktionieren würde: https://docs.typo3.org/typo3cms/TCAReference/AdditionalFeatures/WizardsConfiguration/Index.html
'exclude' => 0, 'label' => 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tx_examples_haiku.weirdness', 'type' => 'input', 'size' => 10, 'eval' => 'int', 'type' => 'userFunc', 'userFunc' => 'Documentation\\Examples\\Userfuncs\\Tca->someWizard', 'color' => 'green' ) ) ) ) ),
public function someWizard($PA, $fObj) { // Note that the information is passed by reference, // so it's possible to manipulate the field directly // Here we highlight the field with the color passed as parameter $backgroundColor = 'white'; $backgroundColor = $PA['params']['color']; } $PA['item'] = '<div style="background-color: ' . $backgroundColor . '; padding: 4px;">' . $PA['item'] . '</div>'; // Assemble the wizard itself $output = '<div style="margin-top: 8px; margin-left: 4px;">'; $commonJavascriptCalls = $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] . $PA['fieldChangeFunc']['typo3form.fieldGet'] . ' return false;'; // Create the + button $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value++; " . $commonJavascriptCalls; $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">+</a>'; // Create the - button $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value--; " . $commonJavascriptCalls; $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">-</a>'; $output .= '</div>'; return $output; }
Es wird ein eigenes Input-Feld erzeugt, das mit + und - bedient werden kann. Das Feld wird angelegt, auch die Farbe grün wird angezeigt. Allerdings reagiert der Klick auf + und - überhaupt nicht. In der Browser-Konsole werden keine Fehler ausgeworfen. Ist es für die Version 7.6 veraltet?
Danke für euren Support.