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

While testing with FormTester: onSelectionChanged is not being invoked if DropDownChoice is enabled for notifications

    XMLWordPrintableJSON

Details

    Description

      Method DropDownChoice.onSelectionChanged is never called when testing a drop down by calling formTester.select("dropDownChoiceNotified", 0);

      In my page:

      form.add(new DropDownChoice("dropDownChoiceNotified", candidateChoices, bookChoiceRenderer) {
      private static final long serialVersionUID = 1L;
      protected boolean wantOnSelectionChangedNotifications()

      { return true; }

      protected void onSelectionChanged(Object arg0)

      { super.onSelectionChanged(arg0); throw new RuntimeException("notification "+arg0); }

      });

      In my unit Test I do:
      formTester.select("dropDownChoiceNotified", 0);
      and the drop down component is not being notified.

      It works fine when testing in a container though.

      Attachments

        Activity

          People

            jbq Jean-Baptiste Quenot
            tptodorov Todor Todorov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: