Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1260

CheckBox.setRequired() is not picked up in 1.3-final

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0-final
    • 1.3.1
    • wicket
    • None

    Description

      I found that when upgrading from 1.3-rc2 to 1.3-final, the setRequired() on a CheckBox I had was no longer registered as a field-error when posting the form with no value in the checkbox.

      Steps to reproduce:

      Create a quickstrart project and put the following in the HomePage.java:

      public class HomePage extends WebPage {
      public HomePage(final PageParameters parameters)

      { add(new FeedbackPanel("feedback")); Form f = new Form("f"); add(f); CheckBox agree = new CheckBox("agree", new Model()); agree.setRequired(true); f.add(agree); Button submit = new Button("submit"); f.add(submit); }

      }

      Then HomePage.html:

      <html xmlns:wicket="http://wicket.apache.org">
      <body>
      <div wicket:id="feedback">Feedback</div>

      <form wicket:id="f">
      <label>Agree</label>
      <input type="checkbox" wicket:id="agree" />

      <input type="submit" wicket:id="submit" />
      </form>
      </body>
      </html>

      With 1.3-final I don't get a feedback/error message. With 1.3-rc2, the feedback message "Field 'agree' is required." shows up when I post the form.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ivaynberg Igor Vaynberg
            edvin Edvin Syse
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment