The form fields are not mounted into the edit form

I am using standalone filament tables builder. Here is the ProductTable component which use as a Livewire component. But I can not see form fields, when I click on the edit action.
<?php

namespace App\Livewire\Tables;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;
use Illuminate\Contracts\View\View;

class ProductsTable extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('title')
]);
}

public function table(Table $table): Table
{
return $table
->query(Error::query())
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make() // this edit action does not display the form fields.
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
//
]),
]);
}

public function render(): View
{
return view('livewire.products.products-table');
}
}
<?php

namespace App\Livewire\Tables;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;
use Illuminate\Contracts\View\View;

class ProductsTable extends Component implements HasForms, HasTable
{
use InteractsWithForms;
use InteractsWithTable;

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('title')
]);
}

public function table(Table $table): Table
{
return $table
->query(Error::query())
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make() // this edit action does not display the form fields.
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
//
]),
]);
}

public function render(): View
{
return view('livewire.products.products-table');
}
}
2 Replies
Lara Zeus
Lara Zeus9mo ago
so for ref: the method form is to add a full form to the ProductsTable component the actions wont be able to read that form you will need to use table actions
Action::make('edit')
->form([
/// form
])
->action(// save)
Action::make('edit')
->form([
/// form
])
->action(// save)
Dasun Tharanga
Dasun TharangaOP9mo ago
thanks, using this for now.
Want results from more Discord servers?
Add your server