【发布时间】:2014-10-30 22:54:28
【问题描述】:
我在组件对话框节点中创建了 AEM Touch UI multifield。它有一个select 的子字段。选择控件包含权限列表。这个想法是,作者可以选择多个权限,并且用户必须至少拥有其中一个权限才能看到组件,或者如果没有为该组件指定权限,所有用户都会看到它。下面是对话框选项卡的.content.xml 文件(该选项卡通过granite/ui/components/foundation/include 引用包含在内)。
我可以向多字段添加新权限、更改它们并删除它们,但需要注意的是:我无法删除列表中的最后一个权限。出于某种原因,一旦我选择了某些内容,AEM 就不允许我拥有一个空的多字段。我尝试将allowBlank 设置为true,但我认为此属性不适用于Touch UI——无论哪种方式,它都不能解决问题。
如何允许内容作者删除多字段中的所有项目?
<?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>
【问题讨论】:
标签: aem