dimanche 30 janvier 2022

Remove multiple rows with checkbox

soy nuevo en spring y necesito poder eliminar las filas seleccionadas por medio de un checkbox, esta es mi tabla .html

<div class="col-md-12">
                        <table class="table" id="tableImport">
                            <thead>
                                <tr>
                                    <th scope="col">Remove</th>
                                    <th scope="col">Debt Age Rule</th>
                                    <th scope="col">Reminder</th>
                                    <th scope="col">Frequency</th>
                                    <th scope="col">Reorder</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr th:each="configCampaign:${listConfigCampaigns}">
                                    <td>
                                        <input type="checkbox" name="my-checkbox">
                                    </td>
                                    <td th:text="${configCampaign.debtagerule}"></td>
                                    <td th:text="${configCampaign.remindebttype}"></td>
                                    <td th:text="'Every '+${configCampaign.every} + ' ' + ${configCampaign.unit}"></td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="col-md-12" style="text-align: center">
                            <input class="btn btn-primary" type="button" value="- Remove Selected Action(s)"/>
                        </div>
                    </div>

This table shows me data from an arrayList in memory, nothing with a database, I need to remove those selected objects from the array. At the moment I have my controller like this enter image description here

private int configid;
private String debtagerule;
private String remindebttype;
private int every;
private String unit;
private boolean selected;
//getters and setters



Aucun commentaire:

Enregistrer un commentaire