Display only option keys in selectmany.ftl UI

cancel
Showing results for 
Search instead for 
Did you mean: 
clarabova
Active Member

Display only option keys in selectmany.ftl UI

I am working with a custom datalist with a selectmany field, and I need the select options to be key-value pairs. Per https://docs.alfresco.com/5.0/concepts/forms-reference.html, "If a value for an option also needs to be specified the "First|1,Second|2,Third|3" format can be used." My question is whether anyone can help me customize my implementation so that the keys (First, Second, Third) are what's displayed in the UI?

3 Replies
jpotts
Professional

Re: Display only option keys in selectmany.ftl UI

It is pretty straightforward to create a custom form control that does whatever you want. You can start with the out-of-the-box selectmany.ftl control then adjust it as needed. Have you tried this? Where are you stuck?

clarabova
Active Member

Re: Display only option keys in selectmany.ftl UI

Hi Jeff, 

I have functionality set up so that when a change is made to a datalist, then an API call is made that sends out info on the updated item. As I mentioned before, I have a selectmany in the datalist that I would like to display First, Second, Third, for example, on the form and datalist grid, but then I need the 1, 2, 3 (which represents a UUID relating to my third-party) to be the value stored in the datalist, and subsequently sent over on the API call. Right now, 1, 2, 3 is displayed on the datalist grid as well. So, now that I'm explaining it, I'm kind of thinking I need to change the datagrid view. Does that sounds right to you?

jpotts
Professional

Re: Display only option keys in selectmany.ftl UI

It is hard to say without seeing it. I was just pointing out that if the selectmany is not working the way you want it to, you can easily switch it out to be a custom selectmany form control that works exactly the way you want it to.