首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何防止cq:对话框继承

如何防止cq:对话框继承
EN

Stack Overflow用户
提问于 2015-09-17 04:10:35
回答 4查看 12.2K关注 0票数 11

我正在迁移经典ui对话框以触摸ui对话框,迁移了父组件对话框,我观察到AEM也显示了子组件中的父对话框选项卡和属性。在现有的经典ui对话框中,它不继承父属性,而在触摸ui中则继承父属性。

通过防止对话框继承,我们如何在touch ui中实现相同的经典ui行为。

如果有人有关于这个问题的信息,请分享详细信息。

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-09-17 16:06:34

可以使用sling:hideChildren属性隐藏继承的选项卡和属性。例如,假设您希望隐藏继承的permissionscloudservices选项卡,并自定义basicadvanced选项卡:

代码语言:javascript
运行
复制
...
<items jcr:primaryType="nt:unstructured">
    <tabs
        ...>
        <layout
            .../>
        <items
            jcr:primaryType="nt:unstructured"
            sling:hideChildren="[permissions,cloudservices]">
            <basic
                .../>
            <advanced
                .../>
        </items>
    </tabs>
</items>
...
票数 20
EN

Stack Overflow用户

发布于 2015-09-17 16:39:32

与AEM文档合并的Sling资源可以找到这里。特别是查看资源合并属性的文档,以及如何操作不同的属性。

资源合并提供了以下属性:

sling:hideProperties (String或String[])指定要隐藏的属性或属性列表。通配符*隐藏所有。

sling:hideResource (布尔值)指示是否应该完全隐藏资源,包括其子资源。

sling:hideChildren (String或String[])包含要隐藏的子节点或子节点列表。将维护节点的属性。通配符*隐藏所有。

sling:orderBefore (String)包含当前节点应位于其前面的同级节点的名称。

这些属性影响覆盖/覆盖(通常在/libs中)如何使用相应/原始资源/属性(来自/apps)。

票数 11
EN

Stack Overflow用户

发布于 2017-07-14 07:21:39

添加

sling:hideChildren性质

到子组件的对话框。

可以将此属性添加到需要隐藏的特定字段集/选项卡/字段的直系亲属中。

语法:

属性名称:吊索:隐藏儿童

属性类型:字符串或String[]

属性值:直接子级的名称,*隐藏它们

示例:

若要隐藏以下对话框的“属性”选项卡下的所有字段,请执行以下操作:

代码语言:javascript
运行
复制
<content
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/container">
    <items jcr:primaryType="nt:unstructured">
        <fixedcolums
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
            <items jcr:primaryType="nt:unstructured">
                <properties
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/container">
                    <items jcr:primaryType="nt:unstructured">
                        <startLevel
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                            ../>
                        <showHidden
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                            ../>
                    </items>
                </properties>
            </items>
        </fixedcolums>
    </items>
</content>

将sling:hideChildren属性添加到其直接父节点,即项(参见下面)

代码语言:javascript
运行
复制
<content
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/container">
    <items jcr:primaryType="nt:unstructured">
        <fixedcolums
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
            <items jcr:primaryType="nt:unstructured"
                sling:hideChildren="*">
                <properties
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/container">
                    <items jcr:primaryType="nt:unstructured">
                        <startLevel
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                            ../>
                        <showHidden
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                            ../>
                    </items>
                </properties>
            </items>
        </fixedcolums>
    </items>
</content>

若要仅隐藏startLevel字段,请将sling:hideChildren属性添加到其直接父节点(请参见下面)

代码语言:javascript
运行
复制
<content
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/container">
    <items jcr:primaryType="nt:unstructured">
        <fixedcolums
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
            <items jcr:primaryType="nt:unstructured">
                <properties
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/container">
                    <items jcr:primaryType="nt:unstructured"
                        sling:hideChildren="startLevel">
                        <startLevel
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                            ../>
                        <showHidden
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                            ../>
                    </items>
                </properties>
            </items>
        </fixedcolums>
    </items>
</content>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32622443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档