<?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 get value from parent node for custom field in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291035#M244165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am developing a custom form control for a form.&amp;nbsp; I want to be able to get a value from the parent folder for the form.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to get the value of a property from the parent folder to be populated in the custom form, something like the following?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;div class="form-field"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;*&amp;lt;/span&amp;gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="${fieldHtmlId}" type="text" name="${field.name}" value="${parent.properties['parentField'].value}" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;#if field.disabled&amp;gt;disabled="true"&amp;lt;/#if&amp;gt; /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/#if&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2013 19:51:52 GMT</pubDate>
    <dc:creator>pchoe</dc:creator>
    <dc:date>2013-09-23T19:51:52Z</dc:date>
    <item>
      <title>get value from parent node for custom field</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291035#M244165</link>
      <description>I am developing a custom form control for a form.&amp;nbsp; I want to be able to get a value from the parent folder for the form.Is there a way to get the value of a property from the parent folder to be populated in the custom form, something like the following?&amp;lt;div class="form-field"&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;label</description>
      <pubDate>Mon, 23 Sep 2013 19:51:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291035#M244165</guid>
      <dc:creator>pchoe</dc:creator>
      <dc:date>2013-09-23T19:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: get value from parent node for custom field</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291036#M244166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's no easy way to do this through configuration.&amp;nbsp; One approach would be to write a custom AJAX method that makes an asynchronous call to an Alfresco webscript when your form loads.&amp;nbsp; You can write this webscript in a way that retrieves the necessary information from the parent node and then on successful callback populates your form field(s) with the the metadata that you're looking for.&amp;nbsp; This is probably more work than you were hoping to have to do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2013 23:28:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291036#M244166</guid>
      <dc:creator>parzgnat</dc:creator>
      <dc:date>2013-09-25T23:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: get value from parent node for custom field</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291037#M244167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The main thing to talk about here is the missing controller hook: The current functionality of adding a custom form control to share is limited to configure a freemarker template which has to render the control HTML. This works for simple cases, but often some controller logic is required to drive the new control (execute a search for a list, query the parent, do a remote call to the master database). So why cant a webscript be configured? The webscript controller could then do all the fun stuff.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I only know a hacky and rather advanced way to do this know, by defining a surf region/component that is included in the control freemarker. The region/component is then wired to a share webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This works but has the drawback that any parameters or state (e.g. the current node, form value) has to pushed using request attributes - because there is no way in surf/share to parameterise a region/component call in the freemarker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other solutions to your problem besides the AJAX way (I used all discussed here) whould be to add a form filter on the repository side that adds the required information from your parent space as "virtual fields" to the form model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope Alfresco engineering will extend the custom form templates to include a webscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lothar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 07:42:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-value-from-parent-node-for-custom-field/m-p/291037#M244167</guid>
      <dc:creator>lotharmärkle</dc:creator>
      <dc:date>2013-09-26T07:42:00Z</dc:date>
    </item>
  </channel>
</rss>

