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')
)
SelectionGroup_small.ss
template which is used when you nest fields. Just create it in your theme and modify it. Could also be worth raising an issue on github – Virile->setSmallFieldHolderTemplate('SelectionGroup_small')
to theSelectionGroup
starts to fix it however using the markup fromSelectionGroup
doesn't fix the issue (thought it would look odd but be somewhat functional, it brings back the radio boxes but none of the fields beneath work). – Crime