Custom page form showing as $this->form

Hi, I'm trying to build a single custom page to edit a particular record My view file is as follow
<x-filament-panels::page>
<x-filament-panels::form wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form wire:submit="save">
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
However, it look like this
No description
10 Replies
Dennis Koch
Dennis Koch11mo ago
Is this a .blade.php file? Or did you miss the .blade extension?
pocket.racer
pocket.racerOP11mo ago
ur right! silly me but now i have a new error getCachedFormActions does not exist.
Dennis Koch
Dennis Koch11mo ago
Did you add all required traits to your component?
pocket.racer
pocket.racerOP11mo ago
my class is something like this
class EditDescription extends Page implements HasForms
{
use InteractsWithForms;
class EditDescription extends Page implements HasForms
{
use InteractsWithForms;
did i miss any trait? ah okay interacts with form action
Dennis Koch
Dennis Koch11mo ago
Just checked: getCachedFormActions() is a method of the EditRecords page. Not of the form. That's why it's not available
pocket.racer
pocket.racerOP11mo ago
i added that the form appeared after i added use InteractsWithFormActions; But the submit button didn't appear
pocket.racer
pocket.racerOP11mo ago
hmm i would have thought this would have added the submit button but it didn't make it appear
<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
WIll look at ur link next ok it looks like i have another custom page and the submit button appear and i am using what i said above, yet it doesn't appear for this page
Dennis Koch
Dennis Koch11mo ago
Did you specify the action on the page?
pocket.racer
pocket.racerOP11mo ago
ur right I put this in the end and it work. Hope it's the recommended way
public function getFormActions(): array
{
return [
Action::make('save')->action(
function (): void {
$this->update();
}
),
];
}
public function getFormActions(): array
{
return [
Action::make('save')->action(
function (): void {
$this->update();
}
),
];
}
Want results from more Discord servers?
Add your server