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 have a Quote Entity with relations (QuoteVersion that also has sub-relations).
for context (Project -> Quote -> QuoteVersion -> Chunk -> ChunkDetail)
The live component I created for this form looks like:
#[LiveProp(onUpdated: 'updateField')]
public Quote $initialFormData;
#[LiveProp]
public Project $project;
#[LiveProp]
public ?QuoteVersion $quoteVersion = null;
protected function instantiateForm() : FormInterface
{
$quote = $this->initialFormData;
$quote->setProject($this->project);
$quoteVersion = $this->quoteVersion ?? (new QuoteVersion())->setLanguage(Language::LANGUAGE_EN)->addChunk((new Chunk()));
$quote->addQuoteVersion($quoteVersion);
return $this->createForm(QuoteType::class, $quote, [
'project' => $this->project,
'quoteVersion' => $quoteVersion
]);
}
public function updateField(): void
{
//$this->formValues['legalNotes'] = 'helloooo';
dd($this->formValues);
}
My goal is to set a field in the updateField method whenever my form is re-rendered for validation, but my dd function never triggers.
onUpdated seems to be working only for props that are not Entities. Is there any way around this or am I just doing it wrong?
The text was updated successfully, but these errors were encountered:
If I use the writable: true, does not work onUpdated on the property.
#[LiveProp(writable: true, onUpdated: ['title' => 'onTitleUpdated'])]
public Post $post;
I just read this
By default, the user can't change the properties of an entity LiveProp You can allow this by setting writable to property names that should be writable. This also works as a way to make only some keys of an array writable:
Question:
How can i catch the value of property when the form changes?
I have a Quote Entity with relations (QuoteVersion that also has sub-relations).
for context (Project -> Quote -> QuoteVersion -> Chunk -> ChunkDetail)
The live component I created for this form looks like:
My goal is to set a field in the updateField method whenever my form is re-rendered for validation, but my dd function never triggers.
onUpdated seems to be working only for props that are not Entities. Is there any way around this or am I just doing it wrong?
The text was updated successfully, but these errors were encountered: