You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I change payload from frontend with $this->formValues I expect the form to be rerendered with changed data, BUT form renders as though I didn't change the payload wiht this->formValues
Description:
I have a live form, then type something (for triggering an AJAX), method instantiateForm is called and in this method I change user's payload with $this->formValues live prop, then I expect to see changes accrdingly my changes in $this->formValues live prop, BUT I see data that haven't been changed.
#[AsLiveComponent]
class LiveFormClass extends AbstractController {
#[LiveProp]
public ?Order$initialFormData = null;
protectedfunctioninstantiateForm(): FormInterface
{
$this->setMinimumAvailablePlannedAtToTheFrontendPayload();
return$this->createForm(CustomFormType::class, $this->initialFormData);
}
privatefunctionsetMinimumAvailablePlannedAtToTheFrontendPayload(): void
{
// CHANGE PAYLOAD DATA TO MAKE THE FORM TO BE RERENDERED DIFFERENTLY, BUT IT DOESN'T WORK$this->formValues['plannedAt']['date']['year'] = '2000';
}
}
Maybe it's because of DateTimeType?!
The text was updated successfully, but these errors were encountered:
I was on symfony 7.2 and live components 2.3
But later used symfony 6.4.18 and live component 2.8
Useless, nothing helped, still breaking my head how to refresh the form view BUT I have a valid model data (2000 year in the entity)
But not in the form view🥸
Bug:
When I change payload from frontend with
$this->formValues
I expect the form to be rerendered with changed data, BUT form renders as though I didn't change the payload wihtthis->formValues
Description:
I have a live form, then type something (for triggering an AJAX), method
instantiateForm
is called and in this method I change user's payload with$this->formValues
live prop, then I expect to see changes accrdingly my changes in$this->formValues
live prop, BUT I see data that haven't been changed.Reproduce:
CustomFormType
LiveFormClass
Maybe it's because of DateTimeType?!
The text was updated successfully, but these errors were encountered: