AnsweredAssumed Answered

Custom Form - Rendering Associations

Question asked by ghernando on Aug 6, 2011
Latest reply on Apr 17, 2013 by idwright
My content model has an association.  I'm able to display the association data in the view and edit forms if I don't use a custom template for the layout.
But when I use the custom template, I see:

An error has occured in the Share component: /share/service/components/form.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 07050000 Failed to process template org/alfresco/components/form/form.get.html.ftl
Server: Alfresco Spring WebScripts - v1.0.0 (Release Candidate 2 785) schema 1,000
Time: Aug 5, 2011 4:46:05 PM
Click here to view full technical information on the error.
Exception: freemarker.template.TemplateException - Error executing macro: renderField required parameter: field is not specified.

The custom form template has the following markup.  Everything else in the form renders OK when I remove this markup specific to the association.
Is an 'association' not a field?

         <div class="full-width">
             <@formLib.renderField field=form.fields["prop_mymodel_peer"] />
         </div>

In the form definition I have:

…. 
           <edit-form template="custom-editform-mymodel.ftl" />
            <field-visibility>

               <show id="mymodel:peer" force="true" />
            </field-visibility>

            <appearance>

               <field id="mymodel:peer" label="Associations" set="File">
                    <control template="/org/alfresco/components/form/controls/association.ftl">
                     <control-param name="displayMode">items</control-param>
                     <control-param name="showTargetLink">true</control-param>
                     <control-param name="compactMode">false</control-param>
                     <control-param name="forceEditable">true</control-param>
                  </control>
               </field>
            </appearance>
         </form>

Outcomes