2015-04-24 35 views
1

我正在AEM 6中創建一個簡單表單,並且希望根據其他字段中的響應自動填充某些域。例如:我做了一個下拉列表,選項0 =紅色,1 =黑色,在下面我做了一個文本框。我希望基於在下拉列表中選擇的選項以紅色或黑色自動填充文本框。如何自動填充AEM 6中的表單域

這是我的設置是怎樣看待的時刻:

enter image description here

我在代碼中挖和文件content/forms/af/geometrixx-gov/applicaiton-for-assistance/.content.xml在我看到以下內容:

 <guidedropdownlist_0 
          jcr:created="{Date}2015-04-23T21:06:53.236-04:00" 
          jcr:createdBy="admin" 
          jcr:lastModified="{Date}2015-04-23T21:12:29.957-04:00" 
          jcr:lastModifiedBy="admin" 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Drop-down list" 
          sling:resourceType="fd/af/components/guidedropdownlist" 
          assistPriority="custom" 
          guideNodeClass="guideDropDownList" 
          name="dropdownlist_0" 
          options="[0=red,1=black,2=blue]"/> 
         <guidetextbox_5 
          jcr:created="{Date}2015-04-23T21:12:51.050-04:00" 
          jcr:createdBy="admin" 
          jcr:lastModified="{Date}2015-04-23T21:12:51.050-04:00" 
          jcr:lastModifiedBy="admin" 
          jcr:primaryType="nt:unstructured" 
          jcr:title="Text box" 
          sling:resourceType="fd/af/components/guidetextbox" 
          guideNodeClass="guideTextBox" 
          name="textbox_5"/> 

這是可能實現?

+0

五月這個鏈接將有所幫助:http://docs.adobe.com/docs/en/cq/5-6-1/developing/developing-forms.html#Showing%20and%20Hiding%20Form%20Components –

回答

0

您可以爲您的下拉元素使用偵聽器。你只需要實現'selectionchanged'事件的功能。

這裏有一個類似的問題:In cq5 widget hide and show based on checkbox in dialog

您也可以看看的Adobe CQ小工具API文檔,才能看到什麼事件可爲您的特定的xtype:

​​

相關問題