cancel
Showing results for 
Search instead for 
Did you mean: 

show associations on both sides

jservajean
Confirmed Champ
Confirmed Champ
I have a type A and a type B.
Type A defines a many-to-one association to Type B.
I managed to customize my edit-metadat form for Type A in a way it shows the picker an let me select a Type B.

Now I'd  like to display the list of Types A associated to Type B in the document-details page or in the edit-metatadata form of type B (resulting on the above association). But I don't know how to easily achieve this.

The code currently looks like below :

In custom-model.xml :
<type name="my:typeA">
   <title>Type A</title>
   <parent>cm:content</parent>
   <associations>
      <association name="my:relatedTypesB">
         <source>
            <mandatory>false</mandatory>
            <many>true</many>
         </source>
         <target>
            <class>drh:typeB</class>
            <mandatory>true</mandatory>
            <many>false</many>
         </target>
      </association>
   </associations>
</type>

<type name="my:typeB">
   <title>Type B</title>
   <parent>cm:content</parent>
</type>

In share-config-custom.xml :
<config evaluator="node-type" condition="my:typeA">
   <forms>
      <form>
         <field-visibility>
            <show id="my:relatedTypesB" />
         </field-visibility>
         <appearance>
            <field id="my:relatedTypesB" label="Related Types B">
               <control template="/org/alfresco/components/form/controls/association.ftl">
                  <control-param name="displayMode">list</control-param>
                  <control-param name="showTargetLink">true</control-param>
                  <control-param name="startLocation">{doclib}</control-param>
               </control>
            </field>
         </appearance>
      </form>
   </forms>
</config>

I tried to had the same kind of control on the Type B form, but it doesn't seem to display automatically the other side of the relationship

Is there an obvious way to do that ?
Does it require a custom query/behaviour to add ?
Thanks for the clue…
2 REPLIES 2

gehriga
Champ in-the-making
Champ in-the-making
Hi Julien,

i'm currently trying to achieve the same goal. Did you find any solution to your problem?
Or does anyone else have an idea in the meantime?


Andreas

tomoconnell
Champ in-the-making
Champ in-the-making
Sorry to bump, but did a solution to this eventuate at all? Would be nice to get this working on my alfresco instance.