Ich hatte in der Tat die Definition der Methode in der ext_localconf.php 
vergessen. Ich hätte jetzt gehofft das dies nun der entscheidene Hinweis ist, 
nur funktionieren will es leider trotzdem nicht.

### ext_tables.php ###
<code>
Tx_Extbase_Utility_Extension::registerPlugin(
        $_EXTKEY,
        'Listteaser',
        
'LLL:EXT:example/Resources/Private/Language/locallang_db.xml:plugin.listteaser'
);

$pluginSignature = str_replace('_','',$_EXTKEY) . '_' . listteaser;
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 
'pi_flexform';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . 
'/Configuration/FlexForms/flexform_' .listteaser. '.xml');
</code>

### ext_localconf.php ###
<code>
Tx_Extbase_Utility_Extension::configurePlugin(
        $_EXTKEY,
        'Listteaser',
        array(
                'Teaser' => 'list',
                'AddItemsToFlexform' => 'mainAction',
                
        ),
        // non-cacheable actions
        array(
                'Teaser' => '',
                // Testweise auch hier
                'AddItemsToFlexform' => 'mainAction',
                
        )
);
</code>

Der Rest ist wie bekannt. Weiterhin aber leider der bekannte Fehler. Ich habe 
es jetzt übrigens auch  mit dem Haupt-Controller 
"Tx_Example_Controller_TeaserController" versucht, der die listAction für's FE 
enthält. 

<code>
class Tx_Example_Controller_TeaserController extends 
Tx_Extbase_MVC_Controller_ActionController {

        /**
         * teaserRepository
         *
         * @var Tx_Example_Domain_Repository_TeaserRepository
         */
        protected $teaserRepository;

        /**
         * injectTeaserRepository
         *
         * @param Tx_Example_Domain_Repository_TeaserRepository 
$teaserRepository
         * @return void
         */
        public function 
injectTeaserRepository(Tx_Example_Domain_Repository_TeaserRepository 
$teaserRepository) {
                $this->teaserRepository = $teaserRepository;
        }

        /**
         * action list
         *
         * @return void
         */
        public function listAction() {
        $teasers = 
$this->teaserRepository->getSelectedTeaser($this->settings['teaser']);
        $this->view->assign('teasers', $teasers);
        }

        /**
         * action flexform
         *
         * @return void
         */
        public function flexformAction() {
//        t3lib_div::debug('call flexform');
            $teasers = 
$this->teaserRepository->getSelectedTeaser($this->settings['teaser']);
        }

}
</code>

Dies listAction Methode kann für die FE-Ausgabe ja auf das Repository 
zugreifen. Bei der flexformAction Methode im BE bekomme ich wieder nur "Fatal 
error: Call to a member function getSelectedTeaser() on a non-object".

Anscheinend kommen die "inject"-Methoden beim Aufruf über Flexform garnicht zum 
Einsatz.

-----Ursprüngliche Nachricht-----
Von: typo3-german-boun...@lists.typo3.org 
[mailto:typo3-german-boun...@lists.typo3.org] Im Auftrag von Thomas Nussbaumer
Gesendet: Freitag, 12. Oktober 2012 17:13
An: typo3-german@lists.typo3.org
Betreff: Re: [TYPO3-german] Flexform Select itemsProcFunc mit Extbase inkl. 
ConfigurationManager, Repository

Dies hat nichts mit Flexform zu tun. Die ursprüngliche Lösung funktionert, weil 
in der angegebenen Klasse die Funktion mainAction existiert.

Extbase verwendet Konventionen, beispeilsweise:
- Definition von Controller und Action in ext_localconf.php
- class Tx_Example_Controller_AddItemsToFlexformController
- Datei AddItemsToFlexformController.php im Ordner Controller
- etc.

Nur so funtioniert dein Kontroller!

Gruss. Thomas.


_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an