Infolist Custom ViewEntry added form field validation.

On a custom Infolist page, I added a new custom ViewEntry with a blade file, needs to validate all fields before performing Infolist submit action. ViewEntry::make('acceptConsent')->label('')->view('user-consent::infolists.components.consent-option-checkbox'), Action::make('saveConsents') ->icon('heroicon-o-check-circle') ->color('success') ->before(function (Action $action) { $this->validateConsents($action); }) ->action(function (array $data) { $this->acceptConsent();}), }
9 Replies
Akshay Bokade
Akshay Bokade4mo ago
@Dan Harrin Do you know about this issue? It sounds like a bug.
Dan Harrin
Dan Harrin4mo ago
I have no idea what the original post is talking about tbh if you think something is a bug, create a reproduction repository and open it on GitHub
Akshay Bokade
Akshay Bokade4mo ago
@Dan Harrin Maybe this will clear the picture, https://discord.com/channels/883083792112300104/1206537836216451123 Here, when we click on the action the data present in the repeatable entry is getting wiped out.
Dan Harrin
Dan Harrin4mo ago
please simplify the code example and put it in a reproduction repository as requested
Aravind Ram
Aravind Ram4mo ago
@Dan Harrin I have attached the repo link below https://github.com/akshaybokaderanium/filament-repeatable-entry-issue-repro Steps to setup & replicate issue 1. Clone and install composer 2. Please use .env.example for environment values 3. Create database with the name of "repeatable_entry_issue" 4. Migrate and seed (php artisan migrate:fresh --seed) 5. Use any user from table to login as admin and use "password" word as password 6. After the login, you will be redirected to "consent-option-request" page 7. If you click "Save consent" button you get alert notification. the form fields will get wiped out. We have to show the validation messages on every form fields.
GitHub
GitHub - akshaybokaderanium/filament-repeatable-entry-issue-repro
Contribute to akshaybokaderanium/filament-repeatable-entry-issue-repro development by creating an account on GitHub.
Dan Harrin
Dan Harrin4mo ago
please open an issue with it
Aravind Ram
Aravind Ram4mo ago
GitHub
Custom Infolist Repeatable Entry form field is getting hidden · Iss...
Steps to setup & replicate issue Clone and install composer Please use .env.example for environment values Create a database with the name "repeatable_entry_issue" Migrate and seed (p...
Dan Harrin
Dan Harrin4mo ago
on the filament repo so its in our bug tracker
Aravind Ram
Aravind Ram4mo ago
GitHub
Custom Infolist Repeatable Entry form field is getting hidden · Iss...
Package filament/filament Package Version 3.2 Laravel Version 10.10 Livewire Version 3.0 PHP Version 8.1 Problem description On a custom Infolist page, I have tried to generate dynamic form fields ...