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

Wickettester: submit select via AJAX

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 1.4.18
    • 1.5.1
    • wicket, wicket-extensions
    • None

    Description

      Wickettester always submits the value of a formcomponent.

      see: BaseWickettTester:1459

      Its not possible to override this behavior.

      Selectcomponent (wicket extension) for example expects the optionpath(s) to convert the browser input to modelvalue. The value (modelvalue) doesnt match this so unittests crash at Select:132 with IndexOutOfBoundException

      please let developers override the "getValueBehavior" depending on the formcomponent:

      ...

      String name = formComponent.getInputName();
      //String value = formComponent.getValue();
      String value = getRequestParameterValueForComponent(formComponent);
      ...

      protected String getRequestParameterValueForComponent(FormComponent<?> formComponent){
      return formComponent.getValue();
      }

      so developers can overide the method to support individual components:

      protected String getRequestParameterValueForComponent(FormComponent<?> formComponent){
      if (formComponent instanceof xxxx)

      { return something;; }

      else

      { return super.getRequestParameterValueForComponent(formComponent); }

      }

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              aelsholz Alexander Elsholz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: