2017-08-24 60 views
0

我想創建一個基於標籤的觸摸UI對話框AEM(AEM-6.2)但我面臨的問題隱藏標籤。AEM - 觸摸UI對話框隱藏和顯示下拉選擇標籤

我在對話框中有3個選項卡。

  1. 一般(始終啓用)
  2. 運動(啓用只有當選擇運動)
  3. 電影(啓用僅在選擇電影)

配置之前, '體育' 和'電影'選項卡被隱藏。在「常規」選項卡中,我有一個選擇框「選擇運動」和「選擇電影」。在選擇相應的選項卡應顯示。我嘗試使用下面給出的路徑中提供的步驟,但無法隱藏選項卡。

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

其他參考我們嘗試:https://github.com/aman02deep/aem-6.2/blob/master/tabshideshow.js

內容.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

回答

0

你可以用花崗岩:數據創建一個數據屬性,你可以隱藏和顯示你convinicence使用jQuery。

  1. 添加監聽你的單選按鈕
  2. 添加花崗岩的改變:數據這兩個選項卡
  3. 監聽被調用,隱藏和顯示,根據您的選擇和jQuery。


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

+0

謝謝你的答覆。 我嘗試添加花崗岩:數據到目標選項卡,並使用隱藏顯示腳本中的smilar偵聽器實現。它仍然不是基於選擇隱藏的。 – RAN

+0

1.花崗岩:數據在DOM中添加數據屬性? 2.你能找到你的元素使用jquery來找到特定的自定義數據屬性? –