You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Paul Mogren <PM...@commercehub.com> on 2009/06/03 22:12:54 UTC
Checkbox set in markup is not cleared after first response
Hello,
Given:
- I'm using Wicket 1.3.6.
- A page containing a form containing an unchecked checkbox is sent to the
browser.
- The user does not check the box, and submits the form.
- The form fails validation, and the same page is rendered again as the
response.
I find that suddenly the checkbox becomes checked, if the markup file
happens to have had it checked.
In CheckBox.onComponentTag(ComponentTag), a call to getValue() returns
null - I'm guessing because an unchecked checkbox results in no request
parameter - thus the following code is not reached:
// In case the attribute was added at design time
tag.remove("checked");
I can see in the response HTML that Wicket wrote out the checked="checked"
attribute from the markup file.
Obviously a workaround is not to check the box in the markup, but I think
this is a bug.
Regards,
Paul