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
I also have the same problem. After some research, I noticed that when using a LiveProp assigned to a form that is instantiated with ComponentWithFormTrait, the variable name must not be the same as the form name.
An exception was thrown when rendering a model ("The field name ‘component’ cannot be used by multiple LiveProp properties in a component. Currently, “component” and “formValues” are both trying to use it in “xxx”. Try adding LiveProp(fieldName=“somethingElse”) for the “component” property to avoid this.").
The onUpdated function cannot be triggered because, on line 664 of ux-live-component/src/LiveComponentHydrator.php, the $frontendName variable is equal to “c”. However, what we want is to have “component”, since on line 673, we check whether we have “c” in $dehydratedUpdatedProps. But the problem is that in this last variable, the Live Component only updates the “component” variable, since it's the form variable and not the variable name passed to LiveProps.
I hope I've made myself clear :D
Thanks in advance
I also have the same problem. After some research, I noticed that when using a LiveProp assigned to a form that is instantiated with ComponentWithFormTrait, the variable name must not be the same as the form name.
example:
error :
An exception was thrown when rendering a model ("The field name ‘component’ cannot be used by multiple LiveProp properties in a component. Currently, “component” and “formValues” are both trying to use it in “xxx”. Try adding LiveProp(fieldName=“somethingElse”) for the “component” property to avoid this.").
Consequence:
If we change our variable like this
The onUpdated function cannot be triggered because, on line 664 of ux-live-component/src/LiveComponentHydrator.php, the $frontendName variable is equal to “c”. However, what we want is to have “component”, since on line 673, we check whether we have “c” in $dehydratedUpdatedProps. But the problem is that in this last variable, the Live Component only updates the “component” variable, since it's the form variable and not the variable name passed to LiveProps.
I hope I've made myself clear :D
Thanks in advance
Originally posted by @akyoscommunication in #2057 (comment)
The text was updated successfully, but these errors were encountered: