Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all
I want to set the values for a checkbox list page property in my controller.
This is my code example:
newOrg.SetValue("orgTypes", "3, 6, 9"); contentService.Save(newOrg);
I am getting this error when I try to open the new created page in the backoffice
I am using this example, but I am not sure this is the best approach. Any help is appreciated.
Thank you
Finally I've found a way to do this!!
I have manually created a 'newOrg' and saved it with the following checkbox list values ticked : type1, type2, type3.
Then I went into the database and checked how the value for my checkbox list is stored. This is the format:
"orgTypes":[{"culture":"","seg":"","val":"[\"type1\",\"type2\",\"type3\"]"}]
So I've modified my code to:
newOrg.SetValue("orgTypes", "[\"type1\",\"type2\",\"type3\"]");
Thinking about it, I can probably use the database information for more complex data types as well, like nested properties.
Hope this will help someone else someday :)
This helped me out a couple of years down the line,
Thanks Raluca.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error when setting the values for a checkbox list property
Hi all
I want to set the values for a checkbox list page property in my controller.
This is my code example:
I am getting this error when I try to open the new created page in the backoffice
I am using this example, but I am not sure this is the best approach. Any help is appreciated.
Thank you
Finally I've found a way to do this!!
I have manually created a 'newOrg' and saved it with the following checkbox list values ticked : type1, type2, type3.
Then I went into the database and checked how the value for my checkbox list is stored. This is the format:
"orgTypes":[{"culture":"","seg":"","val":"[\"type1\",\"type2\",\"type3\"]"}]
So I've modified my code to:
Thinking about it, I can probably use the database information for more complex data types as well, like nested properties.
Hope this will help someone else someday :)
This helped me out a couple of years down the line,
Thanks Raluca.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.