我在組件對話框節點中創建了AEM Touch UI multifield
。它有一個select
的子字段。選擇控件包含權限列表。這個想法是,作者可以選擇多個權限,並且用戶必須至少具有其中一個權限才能看到該組件,或者如果沒有爲該組件指定權限,則所有用戶都會看到它。以下是對話框選項卡的.content.xml
文件(該選項卡通過granite/ui/components/foundation/include
參考包含在內)。在AEM Touch UI多字段中允許空白值(選擇字段)
我可以添加新的權限到多字段,更改它們,並刪除它們與一個警告:我無法刪除列表中的最後一個權限。出於某種原因,一旦我選擇了某件事物,AEM不允許我有一個空的多場。我試着將allowBlank
設置爲true,但我認爲這個屬性不適用於Touch用戶界面 - 無論哪種方式,它都不能解決問題。
如何讓內容作者刪除多字段中的所有項目?
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Portal Filters"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<permissions
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldDescription="A user must have at least one of these permissions to view this component"
fieldLabel="Permissions">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
name="./permissions">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/apps/mportal/datasources/permissions"/>
</field>
</permissions>
<missions
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldDescription="A user must have at least one of these missions to view this component"
fieldLabel="Missions">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
name="./missions">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/apps/mportal/datasources/missions"/>
</field>
</missions>
<mtcs
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldDescription="A user must have at least one of these mtcs to view this component"
fieldLabel="MTCs">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
name="./mtcs">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/apps/mportal/datasources/mtcs"/>
</field>
</mtcs>
<languages
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldDescription="A user must have at least one of these languages to view this component"
fieldLabel="Languages">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
name="./languages">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/apps/mportal/datasources/languages"/>
</field>
</languages>
<startdate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/datepicker"
fieldLabel="Start Date"
name="./startdate"/>
<enddate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/datepicker"
fieldLabel="End Date"
name="./enddate"/>
</items>
</jcr:root>