AEM 6.4:cq:dialog多字段使用@Delete保存属性

时间:2019-02-21 14:02:45

标签: adobe aem-6

我正在将cq:dialog设置为使用多字段,该字段在我的组件中包含表单选择或复选框字段。 但是,当我在配置组件时设置该值时,该字段存储有附加的“ @Delete”,并且无法在页面中访问/读取此字段。这是我的cq对话框的context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/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="Test Component"
    sling:resourceType="cq/gui/components/authoring/dialog"
    width="960">
    <content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/foundation/container">
        <layout
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/foundation/layouts/tabs"
            type="nav"/>
        <items jcr:primaryType="nt:unstructured">
            <tab1
                jcr:primaryType="nt:unstructured"
                jcr:title="Main Options"
                sling:resourceType="granite/ui/components/foundation/section">
                <layout
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
                <items jcr:primaryType="nt:unstructured">
                    <column
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/container">
                        <items jcr:primaryType="nt:unstructured">
                            <features
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/foundation/form/multifield"
                                fieldLabel="Config Items"
                                required="{Boolean}false">
                                <field
                                    jcr:primaryType="nt:unstructured"
                                    sling:resourceType="granite/ui/components/foundation/form/fieldset"
                                    acs-commons-nested=""
                                    name="./features">
                                    <layout
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
                                        method="absolute"/>
                                    <items jcr:primaryType="nt:unstructured">
                                        <column
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/foundation/container">
                                            <items jcr:primaryType="nt:unstructured">
                                                <optionA
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/foundation/form/select"
                                                    name="./optionA"
                                                    fieldLabel="Option A"
                                                    >
                                                    <items jcr:primaryType="nt:unstructured">
                                                        <valueA
                                                            jcr:primaryType="nt:unstructured"
                                                            text="Value A"
                                                            value="valueA"/>
                                                        <valueB
                                                            jcr:primaryType="nt:unstructured"
                                                            text="Value B"
                                                            value="valueB"/>                                    
                                                    </items>
                                                </optionA>                                                                                                  
                                            </items>
                                        </column>
                                    </items>
                                </field>
                            </features>                          
                        </items>
                    </column>
                </items>
            </tab1>                     
        </items>
    </content>
</jcr:root>

当我在CRX中查看已配置组件的属性时,会得到以下信息:

  • 名称:功能
  • 类型:字符串
  • 值:{“ optionA @ Delete”:“ valueA”}

在我的组件jsp中(是的,我知道我没有使用Sightly),我按如下方式访问配置:

<c:set var="items" value="${widgets:getMultiFieldPanelValues(resource, 'features')}"/>
<c:forEach items="${features}" var="feature">
  ${feature.optionA}
</c:forEach>

,但它从未找到该选项A。我在这里想念什么? 预先感谢!

0 个答案:

没有答案