Hi guys,
I've been using the wonderful MultiSelectField add-on http://addons.silverstripe.org/add-ons/fullscreeninteractive/silverstripe-multiselectfield on a front-end form.
This form is used to edit entries that have already been added via another form. The issue I'm having is that when retrieving an array ($FeedbackCategorySelected) to populate the field with previous selection(s) it doesn't seem to take the argument. For instance if the array was (1,3) it will only display the record for 1 and not 3.
As this field is extending the CheckboxFieldSet I would have assumed it would work in exactly the same way.
Can anyone shed any light on what could be wrong here? Code below.
Many thanks
...
$urlID = $this->request->param('ID');
if(is_numeric($urlID)){
$CallEvent = DataObject::get_by_id("CallEvent", Convert::raw2sql($this->request->param('ID')));
$Feedback = DataObject::get_by_id("Feedback", $CallEvent->FeedbackID);
$FeedbackCategorySelected = $Feedback->FeedbackCategories;
$FeedbackCategory = FeedbackCategoryData::get()->map('ID', 'Title')->toArray();
}
...
$fields = new FieldList(
new MultiSelectField(
'FeedbackCategories',
'Select feedback categories to add or remove',
$FeedbackCategory,
$FeedbackCategorySelected
)
...