femanager
femanager copied to clipboard
Prefill of country field not possible (when using static_info_tables)
It's not possible to prefill the country select field, when using EXT:static_info_tables:
<f:section name="static_info_tables">
<femanager:form.select
id="femanager_field_country"
property="country"
prependOptionLabel="{f:translate(key:'pleaseChoose')}"
prependOptionValue=""
class="form-control"
additionalAttributes="{femanager:Validation.FormValidationData(settings: settings, fieldName: 'country')}">
<f:for each="{femanager:Form.GetCountriesFromStaticInfoTables()}" as="countryName" key="countryCode">
<f:if condition="{countryCode} == '---'">
<f:then>
<f:form.select.option additionalAttributes="{disabled: 1}">{countryName}</f:form.select.option>
</f:then>
<f:else>
<f:form.select.option value="{countryCode}">{countryName}</f:form.select.option>
</f:else>
</f:if>
</f:for>
</femanager:form.select>
</f:section>
Rendering the options as children of femanager:form.select doesn't seem to be compatible with the TS prefill feature. When providing the options as argument, it's working again though.
Working version:
<f:section name="static_info_tables">
<femanager:form.select
id="femanager_field_country"
property="country"
prependOptionLabel="{f:translate(key:'pleaseChoose')}"
prependOptionValue=""
options="{femanager:Form.GetCountriesFromStaticInfoTables(limitCountries:'DEU,AUT,CHE')}"
class="form-control"
additionalAttributes="{femanager:Validation.FormValidationData(settings: settings, fieldName: 'country')}" />
</f:section>
Versions:
- TYPO3: 13.4
- EXT:femanager 13.2