[
https://issues.apache.org/jira/browse/WICKET-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Brad Fritz updated WICKET-2853:
-------------------------------
Attachment: WICKET-2528_quickstart_demo.zip
Quickstart app to demonstrate WICKET-2528 problem where
checked+disabled checkboxes created with CheckBoxMultipleChoice become
unselected on form submit.
If FormTester.submit() behaved more like real browser and did not
submit values for disabled fields, unit test would fail. Problem can
still be observed manually by running "mvn jetty:run", submitting form
as-is, and noting that the "bar" checkbox is unchecked by the submit.
(Tested with Firefox 3.6.3.)
> 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
> Priority: Minor
> Attachments:
> 0001-retainDisabledSelected-for-listmultiplechoice.patch,
> WICKET-2528_quickstart_demo.zip
>
>
> 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.