简体   繁体   English

TCA(flexform)多选

[英]TCA (flexform) multi select

I work on an extension and for a plugin I want to select specific records. 我在扩展和插件工作,我想选择特定的记录。 For that I created a flexform with a TCA select configuration: 为此我创建了一个带有TCA选择配置的flexform:

<T3DataStructure>
  <meta>
    <langDisable>1</langDisable> 

  </meta>
  <sheets>
    <sDEF>
      <ROOT>
        <TCEforms>
          <sheetTitle>TEST</sheetTitle>
        </TCEforms>
        <type>array</type>
        <el>


          <settings.selection>
            <TCEforms>
              <exclude>1</exclude>
              <label>Selection</label>
              <config>
                <type>select</type>      
                <foreign_table>tx_mycollection_domain_model_mycollection</foreign_table>
                <renderType>selectCheckBox</renderType>
                <size>5</size>
                <minItems>3</minItems>
                <maxItems>999</maxItems>
                <foreign_table_where>AND tx_mycollection_domain_model_mycollection.sys_language_uid=###REC_FIELD_sys_language_uid###</foreign_table_where>
              </config>
            </TCEforms>
          </settings.selection>

        </el>
      </ROOT>
    </sDEF>
  </sheets>
</T3DataStructure>

It looks fine, in the backend I have checkboxes to select the records. 它看起来很好,在后端我有复选框来选择记录。 But when I save the plugin only the first checkbox is checked/saved. 但是当我保存插件时,只选中/保存第一个复选框。

Is there something wrong in the configuration or what could be the reason that I can not save multible values? 配置中有什么问题或者我无法保存多值的原因是什么?

<minItems>3</minItems>
<maxItems>999</maxItems>

From the documentation here: https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#properties 从这里的文档: https//docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#properties

These needs to be specified as all lower case, so changing them to: 这些需要全部小写,因此将它们更改为:

<minitems>3</minitems>
<maxitems>999</maxitems>

Should resolve your issue. 应该解决你的问题。 It is saving only 1 right now, since maxitems by default is set to 1. 它现在只保存1,因为默认情况下maxitems设置为1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM