小编tap*_*mip的帖子

如何在 cq 对话框中动态使用下拉元素更改选项?

我想编写一个 AEM 组件,我想在其中添加一些元素。在一个组件中,我想添加三个不同的选项,我想动态更改此选项。

实际上,我尝试将部分代码添加到我的 cq_dilog.xml,但问题是我有三个下拉选项可供选择,但我无法更改触发器元素。

<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"
          xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          jcr:primaryType="nt:unstructured" jcr:title="Text"
          sling:resourceType="cq/gui/components/authoring/dialog">
    <content jcr:primaryType="nt:unstructured"
             sling:resourceType="granite/ui/components/foundation/container">
        <items jcr:primaryType="nt:unstructured">
            <column jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <title jcr:primaryType="nt:unstructured"
                           fieldLabel="Trigger"
                           sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                           filedDescription="URL to the page you will linked to."
                            name="./title"/>
                    <type
                            sling:resourceType="granite/ui/components/foundation/form/select"
                            fieldLabel="Type" name="./type"
                            jcr:primaryType="nt:unstructured">
                        <items jcr:primaryType="nt:unstructured">
                            <option1 jcr:primaryType="nt:unstructured" text="Download" />
                            <option2 jcr:primaryType="nt:unstructured" text="Link" />
                            <option3 jcr:primaryType="nt:unstructured" text="Add" />
                        </items>
                    </type>
                </items>
            </column>
        </items>
    </content>
</jcr:root>
Run Code Online (Sandbox Code Playgroud)

xml components aem

3
推荐指数
1
解决办法
3602
查看次数

标签 统计

aem ×1

components ×1

xml ×1