Not been using CF long, but I have hit (an undoubtedly simple) stumbling block dealing with lists.
I have a component called user that has a list property called roles:
property type="List" name="roles" default="";
(I have set accessors=true so get the setter for free)
Now I want to set the roles as a list, and my understanding (what google tells me) is that initialising lists is just as simple as creating a comma separated string, for example "USER,ADMIN,SUPER" etc.
My problem is, I am trying to set it as a single item list:
user.setRoles("user");
and I am getting the error
The roles argument passed to the SETROLES function is not of type List.
Can anyone point out what I am doing wrong/what I need to do so CF recognises the single item string as a list?
Thanks
Well lists are really just strings with delimiters. What if you change the type to string?