You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (JIRA)" <ji...@apache.org> on 2010/07/06 15:31:51 UTC

[jira] Updated: (WICKET-2935) FormComponent#inputChanged does not properly check enabled/disabled status of the component

     [ https://issues.apache.org/jira/browse/WICKET-2935?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl-Eric Menzel updated WICKET-2935:
-------------------------------------

    Attachment: formdisabled-checkbox-quickstart.tar.gz

A quickstart demonstrating this issue. The home page of this application shows a disabled but checked checkbox. If Wicket 1.4.9 is used, after pressing submit the check mark of the checkbox disappears, even though there should be no change.

> FormComponent#inputChanged does not properly check enabled/disabled status of the component
> -------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2935
>                 URL: https://issues.apache.org/jira/browse/WICKET-2935
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.9
>            Reporter: Carl-Eric Menzel
>         Attachments: formdisabled-checkbox-quickstart.tar.gz
>
>
> We noticed this when we had a panel that contains a number of CheckBox components. Some of these CheckBoxes were checked, the underlying model boolean was true. The panel itself was set to disabled (isEnabled returned false), which correctly caused the checkboxes to be rendered with the attribute disabled="disabled". On a form submit, however, the previously checked boxes were rendered unchecked. Only the internal state of the CheckBox and the rendered HTML changed - the model value was not touched.
> After some debugging, I discovered the problem in FormComponent#inputChanged. That method only checks for isEnabled(), not isEnabledInHierarchy(). Since the CheckBox components themselves were enabled, they were accepting input. The browser, on the other hand, did not send anything, since the checkboxes were marked as disabled. This caused the CheckBox to receive null as its input, which it interprets as false/unchecked. The model was not affected since FormModelUpdateVisitor correctly checks isEnabledInHierarchy().
> Solution: FormComponent#inputChanged needs to call isEnabledInHierarchy instead of isEnabled.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.