Get current checked boxes in ContentService Saving event
I have a doc type using the XML Checkbox Picker and I like get the checked boxes in my .ContentService Saving() event so I can resolve the names, add to comma seprated string and save it to a label.
How can I accomplish this?
When I try to get them as below in the .Saving() event I only get null values
// .productCategory is a NuPicker: XML Checkbox Picker
var productCategories = p.productCategory;
// Loop products categories
foreach (var item in productCategories.PickedKeys)
{
// get the Name for each item and add to string, but they are null?
}
Nope, I did not get it to work! I did realize that the .Saving() occurs before the checkboxes are recreated so I did a really ugly data type and added to that doc type, I do not remember exactly but some javascript that picked up changes on the checkboxes and then I stored them to a hidden input and did a ajax post to a custom api that updated a label with selected checbox ids/values... not pretty but it did work :)
Get current checked boxes in ContentService Saving event
I have a doc type using the XML Checkbox Picker and I like get the checked boxes in my .ContentService Saving() event so I can resolve the names, add to comma seprated string and save it to a label.
How can I accomplish this?
When I try to get them as below in the .Saving() event I only get null values
Hi Anders,
Appreciate this is a late reply, but did you ever solve this ? (was it only on first save that they were null, how about the .Saved() event ?)
Thanks, Hendy
Nope, I did not get it to work! I did realize that the .Saving() occurs before the checkboxes are recreated so I did a really ugly data type and added to that doc type, I do not remember exactly but some javascript that picked up changes on the checkboxes and then I stored them to a hidden input and did a ajax post to a custom api that updated a label with selected checbox ids/values... not pretty but it did work :)
is working on a reply...