SilverStripe PHP Forms - If I nest a SelectionGroup inside a FieldGroup, one of the related SelectionGroup_Items' Radio Box does not show up. Why?
I have a form that has two
FieldGroup
s, and in one of the FieldGroup
s I have a SelectionGroup
.
The
SelectionGroup_Item
s show up in the form FieldGroup
but the radio boxes to select one of the options doesn't show. If I remove the FieldGroup
it then works again.
I've looked at the framework templates, and if I change the
FieldGroup_holder.ss
SmallFieldHolder
to FieldHolder
the radio boxes appear again and work correctly. I've tried following the templates to see which one isn't obeying the SelectionGroup
but I keep getting lost.
Here's an example bit of code
$fields = FieldList::create(
FieldGroup::create(
TextField::create('Name', 'Name')
),
FieldGroup::create(
SelectionGroup::create(
'Test1or2',
array(
SelectionGroup_Item::create(
'Test1', array(
TextField::create('Test1', 'Test1')
),
'Test1'
),
SelectionGroup_Item::create(
'Test2', array(
TextField::create('Test2', 'Test2')
),
'Test2'
)
)
)
)
),
FieldList::create(
FormAction::create('submit', 'Submit')
)
Comments
Post a Comment