Custom page, custom fill form radio reset after picked
Hi everyone, im trying to make a custom page for pivot tables of scoring, the way it works is i want whenever the radio option is pressed, it store right away to database
Im doing it with radiodeck plugin, and i already achieve the storing point right away after picking the radio option, but somehow the radio option wont become selected (refreshed i can say)
I wonder whats wrong with my code, this is my score array
Scores Retrieved
and this is my code
Scoring.php
Pastebin
Scoring.php - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
10 Replies
If you are using opcache you may need to ensure the TeamScore. But why are you filling theScore when you are storing the score already and it is already filled?
try adding
$this->dispatchBrowserEvent('refresh');
to the end of fillScore() too
before that, i want to thank you for the help.
the reason behind that is in case the browser is refreshed, i can keep the latest selected radio on the page by setting the default radio from database
i expect that, but instead everytime i press an option, it udpate the database value, yet the radio is refreshed and not selected
this is my db, also when i try to dispatch browser refresh, i got this error
Method App\Filament\Jury\Pages\Scoring::dispatchBrowserEvent does not exist.

if the browser is refresh that should be filled on mount as normal...
it is not somehow, you can see i can get the score data, yet no select default is made

re refesh ahh it's a filament page. Just saw
Yes, its a custom page with HasForm
$this->formFill on mount should suffice if it's not... look into your code. Its possible the method for fillScore isn't working properly on boot
but it shows the data as you can see in the notification, an array of score point
now that i fix the refershed radio after select, the only problem is mounting wont set the radio default options
https://pastebin.com/BFA9KaSs
Pastebin
Scoring.php (updated) - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Debug the code as to why as the form fill should render it fine