title: Extending page table with field using itemsProcFunc in TYPO3 6.2
body: <p>I'm trying to extend the 'page' properties form by extending the page db table and TCA array from within an extension. This works, except that my custom function won't be called. If I replace my own itemsProcFunc line with a TYPO3 core function itemsProcFunc line it works, but with my own function it never works (I just get an empty result/selectlist, even when I simply return a dummy array: "return array('title','1');".... </p>
  
  <p>Here's my code in my extension's ext_tables.php: </p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  $TCA['pages']['columns'] += array(
      'targetelement' =&gt; array(
          'exclude' =&gt; 0,
          'label' =&gt; 'Target element (first select a target page!)',
          'config' =&gt; array (
              'type' =&gt; 'select',
              'items' =&gt; Array (
                  Array('',0),
              ),
              'size' =&gt; 1,
              'minitems' =&gt; 1,
              'maxitems' =&gt; 1,
              //'itemsProcFunc' =&gt; 'TYPO3\CMS\Backend\View\BackendLayoutView-&gt;addBackendLayoutItems',
              'itemsProcFunc' =&gt; 'Vendor\Myextension\Controller\Hooks\CustomTargetElementSelector-&gt;getContentElements',
          ),
      )
  );
  
  t3lib_extMgm::addToAllTCAtypes('pages', 'targetelement,', '2', 'after:nav_title');
  t3lib_extMgm::addToAllTCAtypes('pages', 'targetelement', '1,5,4,199,254', 'after:title');
  </code></pre>
  
  <p>P.s. I replace Vendor\Myextension for my own namespace of course.</p>
  
  <p>I don't know where to put my function file exactly, I assume in extension\Classes\Controllers\Hooks\CustomTargetElementSelector.php.</p>
  
  <p>My ultimate goal is to display a list of content elements of the selected shortcut page UID..</p>
  
  <p>P.s.2 my CustomTargetElementSelect.php file looks like this (contents just return a single item, dummy  list result:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace Vendor\Myextension\Controller;
  
  class CustomTargetElementsSelector extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
  
      public function getContentElements(array &amp;$params,$pObj){
  
          return array('title','uid');
  
      }
  }
  </code></pre>