<?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: SDK 3 - Populate fields with pickerresults in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65035#M22069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now i can add info (ex: "username") in the Json result but i don't know how to populate the field with this value...&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/19270_pastedImage_1.png" style="width: 806px; height: 467px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Feb 2018 11:52:13 GMT</pubDate>
    <dc:creator>anakin59490</dc:creator>
    <dc:date>2018-02-14T11:52:13Z</dc:date>
    <item>
      <title>SDK 3 - Populate fields with pickerresults</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65034#M22068</link>
      <description>Hi,i don't find how to fill fields after using pickerresults :step 1 -&amp;nbsp;select :step 2&amp;nbsp;- choice :step 3 : what i would like to do :I don't find which files are concerned...Thx</description>
      <pubDate>Mon, 12 Feb 2018 10:28:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65034#M22068</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2018-02-12T10:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: SDK 3 - Populate fields with pickerresults</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65035#M22069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now i can add info (ex: "username") in the Json result but i don't know how to populate the field with this value...&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/19270_pastedImage_1.png" style="width: 806px; height: 467px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 11:52:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65035#M22069</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2018-02-14T11:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: SDK 3 - Populate fields with pickerresults</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65036#M22070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok,&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i try to add an "onclick" function on OK button in picker.inc.ftl (bold code) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#assign compactMode = field.control.params.compactMode!false&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#macro renderPickerJS field picker="picker"&amp;gt;&lt;BR /&gt; &amp;lt;@renderPickerJS field "picker" false/&amp;gt;&lt;BR /&gt;&amp;lt;/#macro&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#macro renderPickerJS field picker="picker" cloud=false&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.selectedValueContextProperty??&amp;gt;&lt;BR /&gt; &amp;lt;#if context.properties[field.control.params.selectedValueContextProperty]??&amp;gt;&lt;BR /&gt; &amp;lt;#local renderPickerJSSelectedValue = context.properties[field.control.params.selectedValueContextProperty]&amp;gt;&lt;BR /&gt; &amp;lt;#elseif args[field.control.params.selectedValueContextProperty]??&amp;gt;&lt;BR /&gt; &amp;lt;#local renderPickerJSSelectedValue = args[field.control.params.selectedValueContextProperty]&amp;gt;&lt;BR /&gt; &amp;lt;#elseif context.properties[field.control.params.selectedValueContextProperty]??&amp;gt;&lt;BR /&gt; &amp;lt;#local renderPickerJSSelectedValue = context.properties[field.control.params.selectedValueContextProperty]&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#if cloud&amp;gt;&lt;BR /&gt; var ${picker} = new Alfresco.CloudObjectFinder("${controlId}", "${fieldHtmlId}").setOptions(&lt;BR /&gt; &amp;lt;#else&amp;gt;&lt;BR /&gt; var ${picker} = new Alfresco.ObjectFinder("${controlId}", "${fieldHtmlId}").setOptions(&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; &amp;lt;#if form.mode == "view" || (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;&lt;BR /&gt; field: "${field.name}",&lt;BR /&gt; compactMode: ${compactMode?string},&lt;BR /&gt; &amp;lt;#if field.mandatory??&amp;gt;&lt;BR /&gt; mandatory: ${field.mandatory?string},&lt;BR /&gt; &amp;lt;#elseif field.endpointMandatory??&amp;gt;&lt;BR /&gt; mandatory: ${field.endpointMandatory?string},&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.startLocation??&amp;gt;&lt;BR /&gt; startLocation: "${field.control.params.startLocation}",&lt;BR /&gt; &amp;lt;#if form.mode == "edit" &amp;amp;&amp;amp; args.itemId??&amp;gt;currentItem: "${args.itemId?js_string}",&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if form.mode == "create" &amp;amp;&amp;amp; form.destination?? &amp;amp;&amp;amp; form.destination?length &amp;amp;gt; 0&amp;gt;currentItem: "${form.destination?js_string}",&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.startLocationParams??&amp;gt;&lt;BR /&gt; startLocationParams: "${field.control.params.startLocationParams?js_string}",&lt;BR /&gt; &amp;lt;/#if&amp;gt;&lt;BR /&gt; currentValue: "${field.value}",&lt;BR /&gt; &amp;lt;#if field.control.params.valueType??&amp;gt;valueType: "${field.control.params.valueType}",&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if renderPickerJSSelectedValue??&amp;gt;selectedValue: "${renderPickerJSSelectedValue}",&amp;lt;/#if&amp;gt;&lt;BR /&gt; &amp;lt;#if field.control.params.selectActionLabelId??&amp;gt;selectActionLabelId: "${field.control.params.selectActionLabelId}",&amp;lt;/#if&amp;gt;&lt;BR /&gt; selectActionLabel: "${field.control.params.selectActionLabel!msg("button.select")}",&lt;BR /&gt; minSearchTermLength: ${field.control.params.minSearchTermLength!'1'},&lt;BR /&gt; maxSearchResults: ${field.control.params.maxSearchResults!'1000'}&lt;BR /&gt; }).setMessages(&lt;BR /&gt; ${messages}&lt;BR /&gt; );&lt;BR /&gt;&amp;lt;/#macro&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;#macro renderPickerHTML controlId&amp;gt;&lt;BR /&gt; &amp;lt;#assign pickerId = controlId + "-picker"&amp;gt;&lt;BR /&gt;&amp;lt;div id="${pickerId}" class="picker yui-panel"&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-head" class="hd"&amp;gt;${msg("form.control.object-picker.header")}&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="${pickerId}-body" class="bd"&amp;gt;&lt;BR /&gt; &amp;lt;div class="picker-header"&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-folderUpContainer" class="folder-up"&amp;gt;&amp;lt;button id="${pickerId}-folderUp"&amp;gt;&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-navigatorContainer" class="navigator"&amp;gt;&lt;BR /&gt; &amp;lt;button id="${pickerId}-navigator"&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-navigatorMenu" class="yuimenu"&amp;gt;&lt;BR /&gt; &amp;lt;div class="bd"&amp;gt;&lt;BR /&gt; &amp;lt;ul id="${pickerId}-navigatorItems" class="navigator-items-list"&amp;gt;&lt;BR /&gt; &amp;lt;li&amp;gt;&amp;nbsp;&amp;lt;/li&amp;gt;&lt;BR /&gt; &amp;lt;/ul&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-searchContainer" class="search"&amp;gt;&lt;BR /&gt; &amp;lt;input type="text" class="search-input" name="-" id="${pickerId}-searchText" value="" maxlength="256" /&amp;gt;&lt;BR /&gt; &amp;lt;span class="search-button"&amp;gt;&amp;lt;button id="${pickerId}-searchButton"&amp;gt;${msg("form.control.object-picker.search")}&amp;lt;/button&amp;gt;&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="yui-g"&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-left" class="yui-u first panel-left"&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-results" class="picker-items"&amp;gt;&lt;BR /&gt; &amp;lt;#nested&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-right" class="yui-u panel-right"&amp;gt;&lt;BR /&gt; &amp;lt;div id="${pickerId}-selectedItems" class="picker-items"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="bdft"&amp;gt;&lt;BR /&gt; &amp;lt;button id="${controlId}-ok" &lt;STRONG&gt;onclick="MyFunction()"&lt;/STRONG&gt; tabindex="0"&amp;gt;${msg("button.ok")}&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;button id="${controlId}-cancel" tabindex="0"&amp;gt;${msg("button.cancel")}&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;//&amp;lt;![CDATA[&lt;BR /&gt; &lt;STRONG&gt;MyFunction() {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; console.log("Hello from OK button");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_prop_wfvd_idPatient").innerHTML = "Hello World";&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_prop_wfvd_nomPatient").value = "Populate from OK button";&lt;/STRONG&gt;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;//]]&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/#macro&amp;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;But it doesn't work. moreover&amp;nbsp;the function doesn't appear in field properties :&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/19302_pastedImage_3.png" style="width: 1092px; height: 398px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:48:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65036#M22070</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2018-02-15T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: SDK 3 - Populate fields with pickerresults</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65037#M22071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in picker.inc.ftl, only add :&lt;/P&gt;&lt;P&gt;&amp;lt;script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="${url.context}/res/components/dyn-populate-field.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in&amp;nbsp;&lt;SPAN&gt;dyn-populate-field.js, add :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// remplissage des champs après sélection d'un patient par le picker Alfresco&lt;/P&gt;&lt;P&gt;$(function () {&lt;BR /&gt; &lt;BR /&gt; $("#page_x002e_data-form_x002e_task-edit_x0023_default_assoc_wfvd_patients-cntrl-ok-button")&lt;BR /&gt; .click(function () {&lt;BR /&gt; var patSelected = document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_assoc_wfvd_patients-cntrl-picker-selectedItems").outerText;&lt;BR /&gt; var splits = (patSelected.trim()).split("-");&lt;BR /&gt; console.log(splits);&lt;BR /&gt; document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_prop_wfvd_nomPatient").value = splits[0];&lt;BR /&gt; document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_prop_wfvd_prenomPatient").value = splits[1];&lt;BR /&gt; document.getElementById("page_x002e_data-form_x002e_task-edit_x0023_default_prop_wfvd_dateNaissance").value = splits[2];&lt;BR /&gt; });&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's all !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 14:53:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sdk-3-populate-fields-with-pickerresults/m-p/65037#M22071</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2018-02-16T14:53:28Z</dc:date>
    </item>
  </channel>
</rss>

