AnsweredAssumed Answered

How can we avoid associations sorting?

Question asked by pitzalis on May 12, 2011
Latest reply on Jan 11, 2012 by sam1980
I have created a custom model cointaining the following aspect:

<aspect name="custom:reviewassignees">
   <associations>
      <association name="custom:reviewAssigneesList">
         <source>
            <mandatory>false</mandatory>
            <many>true</many>
         </source>
         <target>
            <class>cm:person</class>
            <mandatory>false</mandatory>
            <many>true</many>
         </target>
      </association>
   </associations>
</aspect>

In my share-config-custom.xml I add:

<config evaluator="aspect" condition="custom:reviewassignees">
   <forms>
      <form>
         <field-visibility>
            <show id="custom:reviewAssigneesList"/>
         </field-visibility>
         <appearance>            
            <field id="custom:reviewAssigneesList" >
               <control template="/org/alfresco/components/form/controls/authority.ftl" >
                  <control-param name="showTargetLink">true</control-param>
               </control>
            </field>
         </appearance>
      </form>
   </forms>
</config>

I use it to associate a list of users to a document.
I need theese users to be kept in the list in the same order as they are entered, but it happens that, the moment we save the document's metadata, the list is sorted in alphabetical order.

Does anyone know how to avoid this behaviour?
Thanks,
GP

Outcomes