-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data option not working #26
Comments
Same for me. With this code, the domain field doesn't change its value when an other folder is selected: $builder->addDependent('domain', 'folder', function (DependentField $field, ?Folder $folder) {
$field->add(EntityType::class, [
'class' => Domain::class,
'choice_label' => 'host',
'choice_value' => fn (?Domain $entity): string => $entity ? $entity->getPublicId()->toRfc4122() : '',
'choices' => $folder?->getTeam()->getDomains(),
'label' => 'links.form.domain_label',
'help' => 'links.form.domain_help',
'required' => false,
'data' => $folder?->getDomain(),
]);
}); |
I have the same problem. Even if I pass the initial value to the domain data object, the value is removed as soon as my field becomes visible. Does anyone already have a solution or workaround? |
I did some debugging and found out that it could be solved by an adjustment in the |
So can we consider that this issue is not related to dynamic-form and close it? |
ok i close it |
Hello,
I'm trying to use the bundle to display selects only if previous value has been selected and select a default value in the list but when i use the 'data' parameters in my dependent form type no options is selected by default. I'm working with live components.
Here is my dependent field declaration :
If i'm in edit mode the data are populated well.
My form is configurated with no data_class
The text was updated successfully, but these errors were encountered: