Pipe data in POST-Controller with dynamically created th:name's (Spring Web, Thymeleaf)

So basically I want, that the th:name stated in the screenshot, the value gets piped into the form-class. Normally you would have i.e. th:name=${someName} and with the POST-request, it gets piped into Form.someName and you can get it with getSomeName(). But in my cae, these th:name's are rendered dynamically with the list-size and each tbody has these two fields. i need to solve it this way, because otherwise, i would only be able to chose on radio button of all and i would only get that value, which is obv nonsene.
No description
No description
No description
No description
10 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Suika! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2mo ago
First of all, you might want to consider using radio button groups I think to make sure you know which ones belong together/shouldn't be selected together and what exactly happens with the current approach?
Suika
SuikaOP2mo ago
i actually just fixed it seconds ago solution was to add array Boolean[] b = new Boolean[size]; lol how do i use radio button groups i googled it but all i get is tyoe="radio"
dan1st
dan1st2mo ago
Stack Overflow
Multiple radio button groups in one form
Is it possible to have multiple radio button groups in a single form? Usually selecting one button deselects the previous, I just need to have one of a group deselected. <form> <field...
dan1st
dan1st2mo ago
it seems like having the same name is fine
Suika
SuikaOP2mo ago
my buttons have the same group i mean name but it loks cleaner above
dan1st
dan1st2mo ago
yeah I didn't know how radio button groups work xd I just knew they existed
Suika
SuikaOP2mo ago
hahaha thanks anyway
JavaBot
JavaBot2mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot2mo ago
Post Closed
This post has been closed by <@653351602983272459>.
Want results from more Discord servers?
Add your server