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-palette-test.zip
        8 kB
        Vincent MATHON
      2. WICKET-5086.patch
        0.9 kB
        Andrea Del Bene

        Issue Links

          Activity

          Vincent MATHON created issue -
          Hide
          Vincent MATHON added a comment -

          A quick start showing the issue.

          Show
          Vincent MATHON added a comment - A quick start showing the issue.
          Vincent MATHON made changes -
          Field Original Value New Value
          Attachment wicket-palette-test.zip [ 12572747 ]
          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).
          Andrea Del Bene made changes -
          Attachment WICKET-5086.patch [ 12574892 ]
          Sven Meier made changes -
          Link This issue is broken by WICKET-5027 [ WICKET-5027 ]
          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
          Sven Meier made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Sven Meier [ svenmeier ]
          Fix Version/s 6.7.0 [ 12323964 ]
          Resolution Fixed [ 1 ]
          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).
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          18d 11h 31m 1 Sven Meier 26/Mar/13 22:51

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development