<?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 Custom form Dropdown in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48025#M18803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I&amp;nbsp;Have create custom form where there are multiple Dropdown.&lt;/P&gt;&lt;P&gt;My requirement is that if i change first Dropdown then second Dropdown would fill&amp;nbsp;base on first Dropdown value and all these values are coming from custom constraint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex.Dropdown&amp;nbsp; 1 - Country (Coming from database)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Dropdown 2 -State (need to fill base on country)&lt;/P&gt;&lt;P&gt;Please guide me how to fullfill this type of requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2018 13:58:31 GMT</pubDate>
    <dc:creator>sp2</dc:creator>
    <dc:date>2018-08-08T13:58:31Z</dc:date>
    <item>
      <title>Custom form Dropdown</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48025#M18803</link>
      <description>Hi,I&amp;nbsp;Have create custom form where there are multiple Dropdown.My requirement is that if i change first Dropdown then second Dropdown would fill&amp;nbsp;base on first Dropdown value and all these values are coming from custom constraint.Ex.Dropdown&amp;nbsp; 1 - Country (Coming from database)&amp;nbsp; &amp;nbsp; &amp;nbsp; Dropdown 2 -State</description>
      <pubDate>Wed, 08 Aug 2018 13:58:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48025#M18803</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-08T13:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Custom form Dropdown</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48026#M18804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;B&gt;Sanjay Bandhniya&lt;/B&gt;‌&lt;/P&gt;&lt;P&gt;You have to write 2 ftl&amp;nbsp;(country.ftl and state.ftl) and associate in *-form-confix.xml file under the&amp;nbsp;&amp;lt;appearance&amp;gt; like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;appearance&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;field id="abc:company"&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &amp;lt;control template="/org/alfresco/components/form/controls/company-dropdown.ftl"&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &amp;lt;/control&amp;gt; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &amp;lt;/field&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;/appearance&amp;gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In company-dropdown.ftl, you&amp;nbsp;need to call the repo webscript&amp;nbsp;to get the list of state based on selected country. Hope you have configured countries in the constraint list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div class="form-field"&amp;gt;&lt;BR /&gt;&amp;lt;script type="text/javascript"&amp;gt;//&amp;lt;![CDATA[cons&lt;BR /&gt;YAHOO.util.Event.onAvailable("${fieldHtmlId}", function(){&lt;BR /&gt;&amp;nbsp;// if want to call something on load.&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function&amp;nbsp;&lt;SPAN&gt;getState&lt;/SPAN&gt;(currentValueHtmlId) {&lt;BR /&gt;this.currentValueHtmlId = currentValueHtmlId;&lt;BR /&gt;var select = Dom.get(this.currentValueHtmlId);&lt;BR /&gt;this.register = function () {&lt;BR /&gt;Alfresco.util.Ajax.jsonGet({&lt;BR /&gt;url: Alfresco.constants.PROXY_URI+"/abc/get-state",&lt;BR /&gt;successCallback: {&lt;BR /&gt;fn: this.updateOptions,&lt;BR /&gt;scope: this&lt;BR /&gt;},&lt;BR /&gt;failureCallback: {&lt;BR /&gt;fn: function(){},&lt;BR /&gt;scope: this&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;};&lt;BR /&gt;this.updateOptions = function (res) {&lt;BR /&gt;var result = res.serverResponse.responseText;&lt;BR /&gt;console.log("Company ." + result);&lt;BR /&gt;if (result.length &amp;gt; 0) {&lt;BR /&gt;var sp=result.split("|");&lt;BR /&gt;for(var i=0;i&amp;lt;sp.length;i++){&lt;BR /&gt;var option = new Option(sp[i].trim(), sp[i].trim());&lt;BR /&gt;select.options[select.options.length] = option;&lt;BR /&gt;} &lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;this.register();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//]]&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;input type="hidden" id="companyName" name="companyName" value=""/&amp;gt;&lt;BR /&gt;&amp;lt;label for="${fieldHtmlId}"&amp;gt;${field.label?html}:&amp;lt;#if field.mandatory&amp;gt;&amp;lt;span class="mandatory-indicator"&amp;gt;${msg("form.required.fields.marker")}&amp;lt;/span&amp;gt;&amp;lt;/#if&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;select id="${fieldHtmlId}" name="${field.name}" tabindex="0" onchange="&lt;SPAN&gt;getState&lt;/SPAN&gt;();"&lt;BR /&gt;&amp;lt;#if field.description??&amp;gt;title="${field.description}"&amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;#if field.control.params.size??&amp;gt;size="${field.control.params.size}"&amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;#if field.control.params.styleClass??&amp;gt;class="${field.control.params.styleClass}"&amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;#if field.control.params.style??&amp;gt;style="${field.control.params.style}"&amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;#if field.disabled &amp;amp;&amp;amp; !(field.control.params.forceEditable?? &amp;amp;&amp;amp; field.control.params.forceEditable == "true")&amp;gt;disabled="true"&amp;lt;/#if&amp;gt;&amp;gt;&lt;BR /&gt;&amp;lt;option value=""&amp;gt;Select&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Sanjay Bandhniya&lt;/B&gt; Please mark helpful if it works.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2018 04:33:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48026#M18804</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-08-19T04:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Custom form Dropdown</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48027#M18805</link>
      <description>Hi, Good information... Is it possible to give complete source on this scenerio like how UI look like,state.ftl and all..</description>
      <pubDate>Fri, 04 Sep 2020 13:24:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48027#M18805</guid>
      <dc:creator>vasanthdev</dc:creator>
      <dc:date>2020-09-04T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom form Dropdown</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48028#M18806</link>
      <description>Hi, Good information... Is it possible to give complete source on this scenario like how UI look like,state.ftl and all..</description>
      <pubDate>Fri, 04 Sep 2020 13:24:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-form-dropdown/m-p/48028#M18806</guid>
      <dc:creator>vasanthdev</dc:creator>
      <dc:date>2020-09-04T13:24:05Z</dc:date>
    </item>
  </channel>
</rss>

