2015-04-24 33 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:

​​

相关问题