How mutateFormDataBeforeFill get the data?
Hi, I create a custom component as I say you few days ago. And I set a select inside.
Component view:
Component controller:
The select is printed well, but when I click the save button, the data don't appears in the
$data
variable of mutateFormDataBeforeFill
function of editRecord.
Why can this be? Is it necessary to include this id in a list or simply by being inside the form should it be taken automatically?9 Replies
because this component container isnt actually registered anywhere
so filament doesnt know to look for the select inside
essentially getChildComponentContainers() needs to return an array of all containers with components
so the default getChildComponentContainer() and then your getSelectComponent()
@Dan Harrin
I have finally managed to get the data out with
implements HasValidationRules
and use CanBeValidated
hmmm why?
you just need to register the containers in the component class
How can I do that?
getChildComponentContainers()
should return [$this->getChildComponentContainer(), $this->getSelectComponent()]
It doesn't works for me because the custom component that I'm making is a Section, and it have another childComponents.
The fields that i get the data are status and text area that are a fixed fields in the component with a modal. Yo can see in the top right corner
yes
but you only need to render the main child component container within the section
and then register the container/s for the modal component/s so that they get discovered by filament
Ok, thanks @Dan Harrin