Keep and validate project type selection when creating/editing application periods #47

Merged
niat8586 merged 3 commits from project-type-lost-application-period-creation into develop 2024-12-16 13:23:38 +01:00
Owner

If you have FormComponents in a ListView you need to call setReuseItems(true) on the ListView. Otherwise the ListItems will be recreated before rendering which results in them losing their "converted input" (what Wicket calls the submitted value).

Instead of simply calling setReuseItems(true) on the ListView, which would've solved the problem, it was instead replaced by a proper FormComponent for dealing with this exact case (a CheckboxMultipleChoice component). This reduces the amount of code required and more clearly communicates intent. The change required some minor test refactoring.

Fixes #33


Now requires at least one project type to be selected before saving.

Fixes #34


How to test

  1. Go to "Admin" / "Match" / "Application periods"
  2. Click create new
  3. Submit without selecting any types
  4. See that there's proper feedback
  5. Leave name blank and select some types
  6. Submit
  7. See that the project type selection sticks around
If you have FormComponents in a ListView you need to call setReuseItems(true) on the ListView. Otherwise the ListItems will be recreated before rendering which results in them losing their "converted input" (what Wicket calls the submitted value). Instead of simply calling setReuseItems(true) on the ListView, which would've solved the problem, it was instead replaced by a proper FormComponent for dealing with this exact case (a CheckboxMultipleChoice component). This reduces the amount of code required and more clearly communicates intent. The change required some minor test refactoring. Fixes #33 --- Now requires at least one project type to be selected before saving. Fixes #34 --- ## How to test 1. Go to "Admin" / "Match" / "Application periods" 2. Click create new 3. Submit without selecting any types 4. See that there's proper feedback 5. Leave name blank and select some types 6. Submit 7. See that the project type selection sticks around
ansv7779 added 1 commit 2024-12-02 14:18:26 +01:00
Fix project type selection being lost on validation error while creating application periods
All checks were successful
Build and test / build-and-test (push) Successful in 10m23s
d2e490bdd8
If you have FormComponents in a ListView you need to call setReuseItems(true) on the ListView. Otherwise the ListItems will be recreated before rendering which results in them losing their "converted input" (what Wicket calls the submitted value).

Instead of simply calling setReuseItems(true) on the ListView, which would've solved the problem, it was instead replaced by a proper FormComponent for dealing with this exact case (a CheckboxMultipleChoice component). This reduces the amount of code required and more clearly communicates intent. The change required some minor test refactoring.
ansv7779 force-pushed project-type-lost-application-period-creation from d2e490bdd8 to db0ea51ed9 2024-12-02 14:28:30 +01:00 Compare
ansv7779 changed title from Fix project type selection being lost on validation error while creating application periods to Keep and validate project type selection when creating/editing application periods 2024-12-02 15:07:42 +01:00
ansv7779 added 1 commit 2024-12-02 15:07:43 +01:00
Require at least one project type to be selected when creating/editing application periods
All checks were successful
Build and test / build-and-test (push) Successful in 7m14s
d387e8002e
niat8586 requested review from niat8586 2024-12-16 12:44:13 +01:00
niat8586 self-assigned this 2024-12-16 12:44:28 +01:00
niat8586 approved these changes 2024-12-16 13:00:10 +01:00
niat8586 left a comment
Owner

👍

👍
niat8586 added 1 commit 2024-12-16 13:00:33 +01:00
Merge branch 'develop' into project-type-lost-application-period-creation
All checks were successful
Build and test / build-and-test (push) Successful in 7m19s
809c427214
niat8586 merged commit f67f37ecdd into develop 2024-12-16 13:23:38 +01:00
niat8586 deleted branch project-type-lost-application-period-creation 2024-12-16 13:23:38 +01:00
Sign in to join this conversation.
No description provided.