AEM - 触摸UI对话框隐藏并显示下拉选项上的选项卡

时间:2017-08-24 05:34:22

标签: dialog cq5 aem sightly

我正在尝试创建一个基于标签的touch-ui对话框AEM(AEM-6.2)但我面临着隐藏标签的问题。

我在对话框中有3个标签。

  1. general(始终启用)
  2. sports(仅在选择运动时启用)
  3. 电影(仅在选择电影时启用)
  4. 在配置之前,' sports'和电影'选项卡被隐藏。在' general'标签我有一个选项框,其中包含选项'选择运动'并选择电影'。在选择时应显示相应的选项卡。我尝试使用下面给定路径中提供的步骤,但它无法隐藏选项卡。

    路径: /libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide/js/dropdownshowhide.js

    我们尝试过的其他参考资料: https://github.com/aman02deep/aem-6.2/blob/master/tabshideshow.js

    Content.xml文件:

                                                                                                                                                                                                                                                                                            

                                    </items>
                                </selection>
                            </items>
                        </columns>
                    </items>
    
            </generalPanel>
             <sports
                jcr:primaryType="nt:unstructured"
                jcr:title="Sports"
                sling:resourceType="granite/ui/components/foundation/container">
                 <layout
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
                    margin="{Boolean}false"/>
                    <items jcr:primaryType="nt:unstructured">
                        <columns
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/container">
                            <items jcr:primaryType="nt:unstructured">
                                 <sptext jcr:primaryType="nt:unstructured"
                                      sling:resourceType="granite/ui/components/foundation/form/textarea"
                                      fieldLabel="enter the text :"
                                      name="./sp_text"
                                      required="false"/>
    
                            </items>
                        </columns>
    
                    </items>
    
            </sports>
            <movies
                jcr:primaryType="nt:unstructured"
                jcr:title="Movies"
                sling:resourceType="granite/ui/components/foundation/container">
                 <layout
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
                    margin="{Boolean}false"/>
                    <items jcr:primaryType="nt:unstructured">
                        <columns
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/container">
                            <items jcr:primaryType="nt:unstructured">
                                 <mvtext jcr:primaryType="nt:unstructured"
                                      sling:resourceType="granite/ui/components/foundation/form/textarea"
                                      fieldLabel="enter the text :"
                                      name="./mv_text"
                                      required="false"/>
    
                            </items>
                        </columns>
    
                    </items>
            </movies>
        </items>
    </content>
    

    dialog box screenshot

1 个答案:

答案 0 :(得分:0)

你可以使用花岗岩:数据创建一个数据属性,你可以隐藏它并使用jquery显示你的信心。

  1. 添加监听器以更改单选按钮
  2. 添加花岗岩:数据到两个标签
  3. 在调用侦听器时,根据您的选择和jquery隐藏和显示。

  4. 参考:https://docs.adobe.com/docs/en/aem/6-1/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/commonattrs.html