cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup drop down list to choose for metadata field???

csiege
Champ in-the-making
Champ in-the-making
I know this has been discussed somewhat on other posts, but could not see a recent post or a real resolution.

I want to provide a down down list for the user to select from when
editing document details (metadata).   This would allow me to enforce the vocabulary.

thanks!

Chris
76 REPLIES 76

gavinc
Champ in-the-making
Champ in-the-making
Not yet, it's something on my list to do!

tiofelix
Champ in-the-making
Champ in-the-making
Sorry, I have the same problem but I did not understand the solution. Wich archives should I modify?? where should I insert this code??

Thanks


There is now a "list of values" constraint in the data dictionary. In your model you can now have the following:


<constraints>
   <constraint name="my:status" type="LIST">
      <parameter name="allowedValues">
         <list>
            <value>Ready</value>
            <value>Steady</value>
            <value>Go</value>
         </list>
      </parameter>
   </constraint>
</constraints>
‍‍‍‍‍‍‍‍‍‍‍‍‍

and then reference the constraint from your property as follows:


<property name="my:status">
   <type>d:text</type>
   <constraints>
      <constraint ref="my:status" />
   </constraints>
</property>
‍‍‍‍‍‍‍‍

gavinc
Champ in-the-making
Champ in-the-making
This would go in your model definition XML file.

Have a look at http://wiki.alfresco.com/wiki/Data_Dictionary_Guide for more information.

tiofelix
Champ in-the-making
Champ in-the-making
I placed that code (constraints) in my model before <types> but i am not sure where i should place this code:

<property name="my:status">
   <type>d:text</type>
   <constraints>
      <constraint ref="my:status" />
   </constraints>
</property>

Sorry, but i new on this. Thanks a lot.

steel
Champ in-the-making
Champ in-the-making
I placed that code (constraints) in my model before <types> but i am not sure where i should place this code:

<property name="my:status">
   <type>d:text</type>
   <constraints>
      <constraint ref="my:status" />
   </constraints>
</property>

Sorry, but i new on this. Thanks a lot.

This is the property definition for a type.
Typically your situation would yield a structure like this:

<constraint>
</constraint>

<type name="">
<property name="my:status">
   <type>d:text</type>
   <constraints>
      <constraint ref="my:status" />
   </constraints>
</property>
</type>

tiofelix
Champ in-the-making
Champ in-the-making
Hi,

   Ok, now i understand it..but i have a new problem. I set up a drop down list like you described but now i want a new one that works like this:

       -ready
       -steady
       -go

     I want a new drop down list and when you choose "ready" displays:
       
        -hi power
        -lo power

      and if you choose "steady" another diferent list..
     Alfresco can do that?? Thanks again.

gavinc
Champ in-the-making
Champ in-the-making
No, unfortunately, we don't support dependent lists.

This may be fairly tricky to accomplish as well as all the components used to represent the lists are built dynamically by the property sheet. This means you don't have access to the relevant component in the JSP to assign a valueChangeListener, which is what is needed here.

If you really need this functionality it's going to be a case of writing some custom code to add this ability. In the meantime feel free to raise this requirement on JIRA.

tiofelix
Champ in-the-making
Champ in-the-making
To be this property mandatory…

<property name="my:status">
<type>d:text</type>
<constraints>
<constraint ref="my:status" />
</constraints>
</property>
‍‍‍‍‍‍‍

…i thought abaut this:

<property name="my:status">
<type>d:text</type>
<constraints>
<constraint ref="my:status" />
</constraints>
<mandatory>true</mandatory>
</property>
‍‍‍‍‍‍‍‍

but unfortunatly… it doesn`t works.

   what am i doing wrong?? Thanks again.

tiofelix
Champ in-the-making
Champ in-the-making
I?ve just found the solution of my problem, don`t disturbe answer me:

 

<property name="my:status">
         <type>d:text</type>
         <mandatory>true</mandatory>
         <constraints>
            <constraint ref="my:status" />
         </constraints>
         </property>      

‍‍‍‍‍‍‍‍‍‍‍

tiofelix
Champ in-the-making
Champ in-the-making
I?ve just found the solution of my problem, don`t disturbe answer me:

 

<property name="my:status">
         <type>d:text</type>
         <mandatory>true</mandatory>
         <constraints>
            <constraint ref="my:status" />
         </constraints>
         </property>      

‍‍‍‍‍‍‍‍‍‍‍