[TYPO3-dev] TCA dynamic selectbox

Thorsten Kahler [dkd] thorsten.kahler at dkd.de
Fri Aug 12 09:30:57 CEST 2011


Hi Diego,

dpino schrieb am 09.08.11 11:24:
> 
>  I'm looking for a way of having a selectbox in BE which when its value 
>  changes it can change the contents of some other selectbox in the same 
>  form. I guess some AJAX might be involved.
> 

there are two ways to update a BE form after changing a field value.
Both do a full reload of the form which includes saving the current
values to DB. So in your "other selectbox" you can react on the new
value of the "triggering selectbox".

1. $TCA[$tablename]['ctrl']['type'] = $field
This configuration option is intended to switch between different types
of records, e.g. content element types. This does not only reload the
BE form but offers the opportunity to change the appearance of the form
(see TCA feature "palettes")

2. $TCA[$tablename]['ctrl']['requestUpdate'] = $fieldlist
This configuration option might be more appropriate in your case. Here
you can define a list of field names that simply trigger a reload of the
BE form (including saving the current values like above).

Have a look at the online documentation for more details:
<http://typo3.org/documentation/document-library/references/doc_core_api>

Cheers,
Thorsten

-- 

Thorsten Kahler
thorsten.kahler at dkd.de




More information about the TYPO3-dev mailing list