I have a livewire event handler on my resource create and edit pages like this:

#[On('copyToText')]
public function handleCopyToText($content): void
{
$this->data['text_content'] = $content;
}
#[On('copyToText')]
public function handleCopyToText($content): void
{
$this->data['text_content'] = $content;
}
This takes the value provided by the livewire function and sets the form component to that value. Works great. Now I want to do the same thing in a relationmanager on another resource, but apparently relationmanagers don't have $this->data. Any ideas how I can achieve the same result? EDIT: Just to clarify, I have to do it this way as $content is obtained from a JS widget that's embedded in the page, not from the rest of the filament form.
Solution:
Ah, got there: ``` #[On('copyToText')] public function handleCopyToText($content): void...
Jump to solution
1 Reply
Solution
_andypeacock
_andypeacock6d ago
Ah, got there:
#[On('copyToText')]
public function handleCopyToText($content): void
{
$this->mountedTableActionsData[0]['text_content'] = $content;
}
#[On('copyToText')]
public function handleCopyToText($content): void
{
$this->mountedTableActionsData[0]['text_content'] = $content;
}

Did you find this page helpful?