Wicket
  1. Wicket
  2. WICKET-5086

FormTester throws an exception when a Palette component is added to a Form associated with a compound property model

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows 7, JDK 1.6_31

      Description

      FormTester throws an exception when a Palette component is added to a Form associated with a compound property model:
      org.apache.wicket.WicketRuntimeException: No get method defined for class ... expression: choices

      It worked fine in Wicket 6.5.0, and works fine if the form is not associated with a compound property model.

      1. WICKET-5086.patch
        0.9 kB
        Andrea Del Bene
      2. wicket-palette-test.zip
        8 kB
        Vincent MATHON

        Issue Links

          Activity

          Hide
          Vincent MATHON added a comment -

          A quick start showing the issue.

          Show
          Vincent MATHON added a comment - A quick start showing the issue.
          Hide
          Andrea Del Bene added a comment -

          The error occurs when BaseWicketTester invokes getValue on the two AbstractOptions inside Palette component. AbstractOptions uses the default getValue defined inside FormComponent which tries to retrieve an inheritable model.
          I think we should override getValue inside AbstractOptions, like we did with updateModel (see attached patch).

          Show
          Andrea Del Bene added a comment - The error occurs when BaseWicketTester invokes getValue on the two AbstractOptions inside Palette component. AbstractOptions uses the default getValue defined inside FormComponent which tries to retrieve an inheritable model. I think we should override getValue inside AbstractOptions, like we did with updateModel (see attached patch).
          Hide
          Sven Meier added a comment -

          AbstractOptions doesn't use its model at all, the actual form value is handled by the recorder component.

          Show
          Sven Meier added a comment - AbstractOptions doesn't use its model at all, the actual form value is handled by the recorder component.
          Hide
          Sven Meier added a comment -

          AbstractOptions does not use its model object, the Recorder does the form processing

          Show
          Sven Meier added a comment - AbstractOptions does not use its model object, the Recorder does the form processing
          Hide
          Paul Bors added a comment - - edited

          As a work-around for 6.6.0 I got away with defining two String properties for my POJO used to mock the unit tests. The two properties are “choices” and “selection”.
          This works because the crash happens when the FormTester is trying to get access to all of the form fields values and attempts to resolve those properties against the backing POJO for the PropertyModel.

          Upgrading to 6.7.0 is not an option for us because of WICKET-5147 "WicketTester MockHttpRequest.getCookies very slow / OutOfMemory" which is fixed in 6.8.0 (scheduled for this Friday, May/17/2013).

          Show
          Paul Bors added a comment - - edited As a work-around for 6.6.0 I got away with defining two String properties for my POJO used to mock the unit tests. The two properties are “choices” and “selection”. This works because the crash happens when the FormTester is trying to get access to all of the form fields values and attempts to resolve those properties against the backing POJO for the PropertyModel. Upgrading to 6.7.0 is not an option for us because of WICKET-5147 "WicketTester MockHttpRequest.getCookies very slow / OutOfMemory" which is fixed in 6.8.0 (scheduled for this Friday, May/17/2013).

            People

            • Assignee:
              Sven Meier
              Reporter:
              Vincent MATHON
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development