<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Default value to select in Dropdown AEM 6.4 in Adobe Social Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/436244#M476</link>
    <description>&lt;P&gt;&lt;LI-USER uid="11127222"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you send screenshot of this node.&lt;/P&gt;&lt;P&gt;I tried created node but it is not resolving the purpose&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 08:45:34 GMT</pubDate>
    <dc:creator>GS04</dc:creator>
    <dc:date>2022-01-05T08:45:34Z</dc:date>
    <item>
      <title>Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261735#M420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a requirement that in the Touch UI dropdowns we have to populate the value dynamically(some logic) using datasource. Now there is 3 drop down in a dilaog and 3 dropdown should have 3 different default value . The datasource is same for all three dropdown. Is there any way in AEM 6.4 to set the default value in&amp;nbsp; dialog. We are able to populate the values in dropdown using datasource but not able to set the default values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sling:ResourceType: granite/ui/components/foundation/form/select&lt;/P&gt;&lt;P&gt;Also is AEM 6.4&amp;nbsp; provides typehead or Autocomplete drops down? we required this because the dropdown list is too large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate for your response .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 08:17:06 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261735#M420</guid>
      <dc:creator>brijesht7477132</dc:creator>
      <dc:date>2018-07-22T08:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261736#M421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How are you setting default value from datasource?&lt;/P&gt;&lt;P&gt;for me works fine to set default value for desire item(option)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #7e504f;"&gt;vm&lt;/SPAN&gt;.put(&lt;SPAN style="color: #3933ff;"&gt;"value"&lt;/SPAN&gt;, &lt;SPAN style="color: #7e504f;"&gt;Value&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #7e504f;"&gt;vm&lt;/SPAN&gt;.put(&lt;SPAN style="color: #3933ff;"&gt;"text"&lt;/SPAN&gt;, &lt;SPAN style="color: #7e504f;"&gt;Text&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #7e504f;"&gt;vm&lt;/SPAN&gt;.put(&lt;SPAN style="color: #3933ff;"&gt;"selected"&lt;/SPAN&gt;, &lt;SPAN style="color: #931a68;"&gt;true&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;Request you to move this in AEM community.&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;Thanks&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 16:31:36 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261736#M421</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2018-07-22T16:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261737#M422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;Thanks for your response. Actually we need something like emptyText which can handle at front end. I tried using emptyText but with datasource it is not working.&lt;/P&gt;&lt;P&gt;Also is it possible to pass any parameter form the datasource to java class ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 18:16:32 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261737#M422</guid>
      <dc:creator>brijesht7477132</dc:creator>
      <dc:date>2018-07-22T18:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261738#M423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested emptyText&amp;nbsp; in AEM 6.3, it works with datasource if you use Coral3 components.&lt;/P&gt;&lt;P&gt;granite/ui/components/&lt;STRONG&gt;coral&lt;/STRONG&gt;/foundation/form/select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be using Coral2 components granite/ui/components/foundation/form/select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, It is possible to pass value in datasource, just create a property in datasource node and assign any value.&lt;/P&gt;&lt;P&gt;In servlet get the request path and from request path get &lt;STRONG&gt;datasource&lt;/STRONG&gt; node resource and adaptTo Node and get property value and use it in servlet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. I created&amp;nbsp; &lt;SPAN style="color: #3933ff; font-family: Monaco; font-size: 11px;"&gt;dropdownSource&lt;/SPAN&gt; property in datasource node and accessing using below code&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #0326cc;"&gt;&amp;nbsp; resourcePath&lt;/SPAN&gt; = &lt;SPAN style="color: #7e504f;"&gt;request&lt;/SPAN&gt;.getRequestPathInfo().getResourcePath();&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #3933ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;resourcePath&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;resourcePath&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.replaceFirst(&lt;/SPAN&gt;"/.*(apps/)(.*$)"&lt;SPAN style="color: #000000;"&gt;, &lt;/SPAN&gt;"/$1$2/"&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #0326cc;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;logger&lt;SPAN style="color: #000000;"&gt;.info(&lt;/SPAN&gt;resourcePath&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp; Node &lt;SPAN style="color: #7e504f;"&gt;itemNode&lt;/SPAN&gt; = &lt;SPAN style="color: #7e504f;"&gt;request&lt;/SPAN&gt;.getResourceResolver().getResource(&lt;SPAN style="color: #0326cc;"&gt;resourcePath&lt;/SPAN&gt;).adaptTo(Node.&lt;SPAN style="color: #931a68;"&gt;class&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&amp;nbsp; &lt;SPAN style="color: #931a68;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #7e504f;"&gt;itemNode&lt;/SPAN&gt;.hasProperty(&lt;SPAN style="color: #3933ff;"&gt;"dropdownSource"&lt;/SPAN&gt;)) {&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;// do something&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 19:25:46 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261738#M423</guid>
      <dc:creator>arunpatidar</dc:creator>
      <dc:date>2018-07-22T19:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261739#M424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. As you suggested putting&amp;nbsp; vm.put("selected",true), The code started breaking with the below exception. It successfully set the selected to true but later it break and once i remove the selected to true it works fine&lt;/P&gt;&lt;P&gt;Can you kindly guide or share your code snippet. Also below sharing my lines of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ValueMap labelValues = new ValueMapDecorator(new HashMap&amp;lt;String, Object&amp;gt;());&lt;/P&gt;&lt;P&gt;String labelKey = (String)labelhit.getResource().getValueMap().get(FollettConstants.LABELKEY_PROPERTY,null);&lt;/P&gt;&lt;P&gt;if(! StringUtils.isEmpty("author_by_prefix") &amp;amp;&amp;amp; "author_by_prefix".equals(labelKey)) {&lt;/P&gt;&lt;P&gt;labelValues.put("selected", true);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;labelValues.put("text", labelKey);&lt;/P&gt;&lt;P&gt;labelValues.put("value", labelKey+FollettConstants.HASH_SEPRATOR+labelhit.getPath());&lt;/P&gt;&lt;P&gt;labelList.add(new ValueMapResource(resourceResolver, new ResourceMetadata(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "nt:unstructured", labelValues));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSource dataSource = new SimpleDataSource(labelList.iterator());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; request.setAttribute(DataSource.class.getName(), dataSource); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco; color: #7e504f;"&gt;Exception&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 23.07.2018 01:36:55.941 *ERROR* [0:0:0:0:0:0:0:1 [1532289997383] GET /mnt/override/apps/follett/components/content/labeldemo/pdpmappedlabels/_cq_dialog.html/content/follett/en/tcustore/pdppage/jcr:content/par/pdpmappedlabels HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException&lt;/P&gt;&lt;P&gt;org.apache.sling.api.request.RecursionTooDeepException: /mnt/override/apps/follett/components/content/labeldemo/pdpmappedlabels/cq:dialog/content/items/mappedlabel/items/column/items/addtobag&lt;/P&gt;&lt;P&gt;at org.apache.sling.engine.impl.request.RequestData.setContent(RequestData.java:571) [org.apache.sling.engine:2.6.12]&lt;/P&gt;&lt;P&gt;at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:311) [org.apache.sling.engine:2.6.12]&lt;/P&gt;&lt;P&gt;at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211) [org.apache.sling.engine:2.6.12]&lt;/P&gt;&lt;P&gt;at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104) [org.apache.sling.engine:2.6.12]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 20:55:56 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/261739#M424</guid>
      <dc:creator>brijesht7477132</dc:creator>
      <dc:date>2018-07-22T20:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/417538#M425</link>
      <description>&lt;P&gt;&lt;LI-USER uid="12875300"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to avoid additonal code for datasource servlet/ sling model.&lt;/P&gt;&lt;P&gt;We can use &lt;STRONG&gt;cq:template&lt;/STRONG&gt; node to set initial default values for any kind of select datasource, textfield, radiogroup, checkbox etc. resource type.&lt;/P&gt;&lt;P&gt;Just add cq:teamplte node inside AEM component.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN&gt;xml version&lt;/SPAN&gt;&lt;SPAN&gt;="1.0" &lt;/SPAN&gt;&lt;SPAN&gt;encoding&lt;/SPAN&gt;&lt;SPAN&gt;="UTF-8"&lt;/SPAN&gt;&lt;SPAN&gt;?&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;jcr&lt;/SPAN&gt;&lt;SPAN&gt;:root &lt;/SPAN&gt;&lt;SPAN&gt;xmlns:&lt;/SPAN&gt;&lt;SPAN&gt;jcr&lt;/SPAN&gt;&lt;SPAN&gt;="http://www.jcp.org/jcr/1.0" &lt;/SPAN&gt;&lt;SPAN&gt;xmlns:&lt;/SPAN&gt;&lt;SPAN&gt;nt&lt;/SPAN&gt;&lt;SPAN&gt;="http://www.jcp.org/jcr/nt/1.0" &lt;/SPAN&gt;&lt;SPAN&gt;xmlns:&lt;/SPAN&gt;&lt;SPAN&gt;cq&lt;/SPAN&gt;&lt;SPAN&gt;="http://www.day.com/jcr/cq/1.0"&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;jcr&lt;/SPAN&gt;&lt;SPAN&gt;:primaryType&lt;/SPAN&gt;&lt;SPAN&gt;="nt:unstructured"&lt;BR /&gt;&lt;/SPAN&gt;    &amp;lt;jcr&lt;SPAN&gt;PropertyName&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;="&amp;lt;default value here&amp;gt;"&lt;/SPAN&gt;&lt;SPAN&gt;/&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 06:48:57 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/417538#M425</guid>
      <dc:creator>Suraj_Kamdi</dc:creator>
      <dc:date>2021-07-29T06:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Default value to select in Dropdown AEM 6.4</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/436244#M476</link>
      <description>&lt;P&gt;&lt;LI-USER uid="11127222"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you send screenshot of this node.&lt;/P&gt;&lt;P&gt;I tried created node but it is not resolving the purpose&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 08:45:34 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-social-questions/default-value-to-select-in-dropdown-aem-6-4/m-p/436244#M476</guid>
      <dc:creator>GS04</dc:creator>
      <dc:date>2022-01-05T08:45:34Z</dc:date>
    </item>
  </channel>
</rss>

