Dasun Tharanga
Dasun Tharanga
FFilament
Created by Dasun Tharanga on 4/1/2024 in #❓┊help
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');
}
}
4 replies
FFilament
Created by Dasun Tharanga on 10/9/2023 in #❓┊help
When using createOptionForm() I can not store the record.
I am using createOptionForm() and I don't have a relationship to add. therefore, I tried to call createOptionUsing() but I am unable to get the form states. How can I access fields states of createOptionForm() ?
3 replies