F
Filamentβ€’2y ago
Nate

Tab that contains a form that is always editable?

I have a tab with a form inside on my resource page. The only problems is you can only access the fields when the form is in create or edit mode. This custom tab contains a form to upload something to S3 and I need the fields always editable even when resource isn't in create or edit mode. Is this possible? Kind Regards Nate
5 Replies
Patrick Boivin
Patrick Boivinβ€’2y ago
Hi @natadata, so this would be on a View page essentially?
Nate
NateOPβ€’2y ago
@pboivin Yes but I want form fields in this tab always editable. If it's a new view page that's ok but just want a tab that has fields I can interact with and a submit button that doesn't require me to click edit first πŸ™‚
Patrick Boivin
Patrick Boivinβ€’2y ago
Interesting problem... I'm not sure I know what would be the best option here but I can think of a simple solution, if you want to explore a bit. You could duplicate your EditTenant page to ViewTenant (a fake view page), and then on the new page, you could disable the fields that should be considered readonly.
->disabled(fn ($livewire) => $livewire instanceof ViewTenant)
->disabled(fn ($livewire) => $livewire instanceof ViewTenant)
Nate
NateOPβ€’2y ago
@pboivin I'll give it a shot thanks for the suggestion. Was going to try a custom widget with a form and attack it to the tenant resource think
Patrick Boivin
Patrick Boivinβ€’2y ago
Good idea! I think a custom form could work on a ViewRecord page.
Want results from more Discord servers?
Add your server