Maintain project selection on validation failure during group creation ()

Fixes 

## How to test
1. Log in as `evan@example.com`
2. Go to "My groups"
3. Click "Create new group"
4. Select some projects but do *not* fill in the "Title"
5. Click save
6. Error message should be presented
7. Project selection should be maintained

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
This commit is contained in:
Andreas Svanberg 2025-03-11 09:15:01 +01:00 committed by Nico Athanassiadis
parent 9ede262e7b
commit 59e3ec3fd9

@ -59,6 +59,11 @@ public class EditGroupPanel extends Panel {
});
add(
new ListView<>("available_projects", availableProjects) {
{
// must re-use list items to maintain form component (checkboxes) state
setReuseItems(true);
}
@Override
protected void populateItem(ListItem<Project> item) {
CheckBox checkbox = new CheckBox("selected", new SelectProjectModel(model, item.getModel()));