If I put the getInputFilterSpecification in the form class then it ignore the rules in that function and does not highlight the fields which should be required.
@froschdesign an update to this.
I updated the individual fieldsets to remove the getInputFilterSpecification() functions so there is only 1 on the main fieldset class. So the required validation for the field is working inside the collection but that only triggers once an items is in the collection. The collection seems to be ignoring the NotEmpty validator assigned to it.
'claimTaskDefinitionResponsibleRoles' => [ 'required' => true, 'validators' => [ [ 'name' => NotEmpty::class, 'options' => array( 'messages' => array( NotEmpty::IS_EMPTY => 'You must select at least 1 Role' ) ) ] ], 'type' => CollectionInputFilter::class, 'input_filter' => [ 'IdRole' => [ 'required' => true ] ] ]
From a UX perspective the collection should display the ‘You must select at least 1 role’ first and then when the user adds an empty item to the collection then the standard required validation should kick in. Have I setup the validator wrong for the collection?
Sorry for the very late response!
I will recheck this at the weekend.