[
https://issues.apache.org/jira/browse/WICKET-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carl-Eric Menzel updated WICKET-2853:
-------------------------------------
Attachment: 0001-retainDisabledSelected-for-listmultiplechoice.patch
Expanded the scope of the patch a bit to also cover the case if the user does
not select anything. #convertChoicesToIds wouldn't be called then, so now
#convertValue() is also patched.
> ListMultipleChoice/CheckBoxMultipleChoice do not retain selected but disabled
> items
> -----------------------------------------------------------------------------------
>
> Key: WICKET-2853
> URL: https://issues.apache.org/jira/browse/WICKET-2853
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.4.8
> Reporter: Carl-Eric Menzel
> Attachments: 0001-retainDisabledSelected-for-listmultiplechoice.patch
>
>
> Suppose in a shop application the user gets to choose from a number of
> options for the product, presented by checkboxes. One or more of these
> options may be mandatory for the given product, so they are not only
> pre-selected in the model and thus checked on the displayed page, but also
> disabled via #isDisabled, so they cannot be deselected.
> On form submit the browser (correctly) does not post these disabled values
> again and ListMultipleChoice#convertChoiceIdsToChoices does not keep these
> values. Upon re-displaying of the page the checkbox is no longer checked, and
> the user can't even check it again, since it is disabled. The behavior is
> demonstrated in the test case contained in the attached patch.
> I propose the attached path to give ListMultipleChoice a new flag called
> retainDisabledSelected. Default in the patch is currently false, though I
> think it could also be set to true. If the flag is true, the patched
> convertChoiceIdsToChoices will go through the old model collection to check
> if any of the selected values were disabled. Any such values will be added to
> the new model collection. If the flag is false, the ListMultipleChoice will
> behave like before. The included testcase verifies the behavior for both flag
> settings.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.