#Help me to select address from address list in modal

6 messages · Page 1 of 1 (latest)

still folio
#

I have created
class AddressForm extends Field
in this Created an action

Forms\Components\TextInput::make("name")
    ->label("Name / Company Name")
    ->maxLength(50)
    ->suffixAction(
        Action::make('select_address')
            ->icon('heroicon-o-magnifying-glass')
            ->action(function (callable $get) {
                $customer_id = $get('../customer_id');
                if (!$customer_id) {
                    Notification::make()
                        ->danger()
                        ->title('Please select customer First')
                        ->send();

                    return;
                }
            })
            ->modalContent(function (callable $get) {
                $customer_id = $get('../customer_id');
                return view('filament.addresses.view', compact('customer_id'));
            })
            ->modalSubmitAction(false)
            ->modalWidth('7xl')
    )->inlineSuffix(),

my view blade file

@php
    $widgetData = [
        'inModal' => true,
        'customer_id' => $customer_id,
    ];
@endphp

<x-filament-widgets::widgets :widgets="[\App\Filament\Widgets\AddressListWidget::class]" :columns="1" :data="$widgetData" />

Created Table widget with

protected function getTableActions(): array
    {
        return [
            Tables\Actions\Action::make('select')
                ->label('Select')
                ->action(function ($record) {
                    $this->emit('addressSelected', $record);
                })
                ->icon('heroicon-o-check'),
        ];
    }

Please Help me to use record to address form

still folio
#

Here What I exactly want that

I have my addresses with relation to customer

In Quotation Form I want to give manual enter address as well and also user can select address from customer's address

When user click on search icon user will see modal with list of customer's address

from the customer's address listed in table with an action button "use address"

I want to use all record to fill in the forms

I mention all codes above

chilly wharf
still folio
#

Thank you for you respond

I have populated address list in table in modal

I have created action in that widget too

now is there any option that I can handle that click in my AddressForm class?