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
{"1":16,"2":14,"3":16,"4":20,"5":null,"6":null}
{"1":16,"2":14,"3":16,"4":20,"5":null,"6":null}
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
toeknee
toeknee3w ago
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
waterflai
waterflaiOP3w ago
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.
No description
toeknee
toeknee3w ago
if the browser is refresh that should be filled on mount as normal...
waterflai
waterflaiOP3w ago
it is not somehow, you can see i can get the score data, yet no select default is made
No description
toeknee
toeknee3w ago
re refesh ahh it's a filament page. Just saw
waterflai
waterflaiOP3w ago
Yes, its a custom page with HasForm
toeknee
toeknee3w ago
$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
waterflai
waterflaiOP3w ago
but it shows the data as you can see in the notification, an array of score point
waterflai
waterflaiOP3w ago
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.
toeknee
toeknee3w ago
Debug the code as to why as the form fill should render it fine

Did you find this page helpful?