Wicket
  1. Wicket
  2. WICKET-1260

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-final
    • Fix Version/s: 1.3.1
    • Component/s: wicket
    • Labels:
      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.

        Issue Links

          Activity

          Edvin Syse created issue -
          Igor Vaynberg made changes -
          Field Original Value New Value
          Link This issue is blocked by WICKET-1221 [ WICKET-1221 ]
          Igor Vaynberg made changes -
          Fix Version/s 1.3.1 [ 12312500 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Igor Vaynberg [ ivaynberg ]

            People

            • Assignee:
              Igor Vaynberg
              Reporter:
              Edvin Syse
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development