WICKET-1221
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8dd0a8c9 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8dd0a8c9 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8dd0a8c9 Branch: refs/heads/master Commit: 8dd0a8c9558308ecab18d3643bdf5bcb97392800 Parents: f3edce1 Author: Igor Vaynberg <[email protected]> Authored: Fri Jan 6 14:16:08 2012 -0800 Committer: Igor Vaynberg <[email protected]> Committed: Fri Jan 6 14:16:08 2012 -0800 ---------------------------------------------------------------------- .../apache/wicket/markup/html/form/CheckBox.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/8dd0a8c9/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java index 9a55cb8..cacd548 100644 --- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckBox.java @@ -43,6 +43,11 @@ import org.apache.wicket.util.convert.IConverter; * You can can extend this class and override method wantOnSelectionChangedNotifications() to force * server roundtrips on each selection change. * </p> + * <p> + * A CheckBox always has a valid therefore values from methods + * {@link FormComponent#setRequired(boolean)} and {@link FormComponent#isRequired()} are not taken + * into account. + * </p> * * @author Jonathan Locke */ @@ -246,4 +251,11 @@ public class CheckBox extends FormComponent<Boolean> implements IOnChangeListene } } + @Override + public boolean checkRequired() + { + // a checkbox always has a value so this check always passes + return true; + } + }
