Redpill-Linpro / alfresco-listmanager

Component used to manage custom list of values used in metadata forms.
13 stars 6 forks source link

customselectmany.ftl does not work #13

Open udaikumar26 opened 6 years ago

udaikumar26 commented 6 years ago

Hi, We tried to use the list manager to manage list of keywords. We were able to select multiple keywords and save the content. However when we go to the edit screen of the alfresco content, the selected values are not highlighted. If i select a single value, it shows as selected but if we select multiple values, none of the value is shown as selected i.e. the selected values are not shown in the edit screen.

billerby commented 6 years ago

Do you get any client-side errors in for example the chrome inspector console (or firebug) etc?

udaikumar26 commented 6 years ago

We found that the below line of code in customselectmany.ft does not work for multi selection.

option.selected = (option.value === selectedValue);

This is because, for multi selection, selectedValue comes out as an array hence we replaced it with the below code and it worked.

option.selected = typeof(selectedValue=== array) ? selectedValue.includes( option.value ) : (option.value === selectedValue)