cancel
Showing results for 
Search instead for 
Did you mean: 

List constraint with key and value

friedman30
Champ in-the-making
Champ in-the-making
Hi,

I need to add a property with a list of values that will not only hold the value itself but a key (that the user will see in the drop down component) and a value (to be used in the backing bean).

Is there any way of doing it ( <List> tag ??? )  using customModel.xml ??

:?:

Thanks,

Dror
4 REPLIES 4

robain
Champ in-the-making
Champ in-the-making
I need something similar. In the properties page the drop-down can stay as it is, but when storing, instead of storing just the display value, i want to store the map of key and value. lets say id and name.
the drop down should look like.
<param value="1">one</param>
<param value="2">two</param>

when added to the list. the display string should look like "1 - one" or something similar.

the main point is both of the key and value should be stored. how do i achieve this ??? any ideas help!!!

jbarmash
Champ in-the-making
Champ in-the-making
No easy way to do it (i.e. without writing any code).  I'd suggest you write a component generator to render your property editor appropriately.  Store values as a string property. 

http://wiki.alfresco.com/wiki/Component_Generator_Framework

There is also ability to define constraints on properties, which does support a list, but I don't think the UI picks that up. 
http://wiki.alfresco.com/wiki/Content_Model_Constraints

robain
Champ in-the-making
Champ in-the-making
Definitely will write some code. Generator part I believe is only for displaying what has been stored. I am not sure how the data is going to be stored a child association with two different attributes? if you could direct me to some code related to this that would be great.

Thanks

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all!

Did you find a solution for the list constraint with key and value?? I need to develop the same and I have no idea how I can do that.
Thanks!

Sergi