[TYPO3-mvc] tca foreign_table_where ###REC_FIELD

Jacco van der Post jacco at id-internetservices.com
Sat Apr 16 18:07:03 CEST 2011


Hi

I have this in my tca



'depends_on_question' => array(
			'exclude'	=> 0,
			'label'		=> 
'LLL:EXT:jpadvisor/Resources/Private/Language/locallang_db.xml:tx_jpadvisor_domain_model_question.depends_on_question',
			'config'	=> array(
				'type' => 'select',
                 'items' => Array (Array('',0), ),
				'foreign_table' => 'tx_jpadvisor_domain_model_question',
                 'foreign_table_where' => 'AND 
tx_jpadvisor_domain_model_question.pid=###CURRENT_PID###',
				'MM' => 'tx_jpadvisor_question_question_mm',
				'size' => 10,
				'autoSizeMax' => 30,
                 'minitems' => 0,
				'maxitems' => 1,
			),
		),



'dependson_answer' => array(
			'exclude'	=> 0,
			'label'		=> 
'LLL:EXT:jpadvisor/Resources/Private/Language/locallang_db.xml:tx_jpadvisor_domain_model_question.dependson_answer',
			'config'	=> array(
				'type' => 'select',
				'foreign_table' => 'tx_jpadvisor_domain_model_answers',
                 'foreign_table_where' => 'AND 
tx_jpadvisor_domain_model_answers.answers_question=###REC_FIELD_depends_on_question###',
				'MM' => 'tx_jpadvisor_question_dependsonanswer_answers_mm',
				'size' => 10,
				'autoSizeMax' => 30,
				'maxitems' => 9999,
			),
		),




If a value in the select box of depends_on_question gets selected in the 
backend, the form gets reloaded by requestUpdate via ext_tables.php and 
the corresponding answers get shown selectable in dependson_answer.

However it does not show the saved selected values of dependson_answer.

When I remove

'foreign_table_where' => 'AND 
tx_jpadvisor_domain_model_answers.answers_question=###REC_FIELD_depends_on_question###'

The selected values do get saved (but than all values are selectable, 
instead of only the corresponding possible answers to a question).


What do I miss?

-- 
Kind Regards

Jacco van der Post


More information about the TYPO3-project-typo3v4mvc mailing list