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

AbstractSingleSelectChoice tries to convert the input using the id generated by IChoiceRenderer

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.17
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket
    • Labels:
      None

      Description

      If one set a type for an AbstractSingleSelectChoice component, it will start to get error because the input being converted to model type was not generated by the converter, but by the IChoiceRenderer.

      1. WICKET-3745.patch
        1.0 kB
        Pedro Santos
      2. WICKET-3745.zip
        48 kB
        Pedro Santos

        Activity

        Hide
        pedrosans Pedro Santos added a comment -

        Quickstart reproducing the problem

        Show
        pedrosans Pedro Santos added a comment - Quickstart reproducing the problem
        Hide
        pedrosans Pedro Santos added a comment -

        possible fix

        Show
        pedrosans Pedro Santos added a comment - possible fix
        Hide
        pedrosans Pedro Santos added a comment -

        @devs, I think AbstractSingleSelectChoice needs to tweak the input to be understood by convertes ( my last patch ). I'm just not sure if this is a good idea, because we can't know for sure who will parse the input since one can override the FormComponent#convertInput method.

        Show
        pedrosans Pedro Santos added a comment - @devs, I think AbstractSingleSelectChoice needs to tweak the input to be understood by convertes ( my last patch ). I'm just not sure if this is a good idea, because we can't know for sure who will parse the input since one can override the FormComponent#convertInput method.
        Hide
        ivaynberg Igor Vaynberg added a comment -

        hrm. what is the usecase for setting a type on a choice component? like you have mentioned - there is no type converstion that is happening here, instead it uses a simple lookup from choice renderer. if anything, we should make calling settype() on it throw an exception.

        Show
        ivaynberg Igor Vaynberg added a comment - hrm. what is the usecase for setting a type on a choice component? like you have mentioned - there is no type converstion that is happening here, instead it uses a simple lookup from choice renderer. if anything, we should make calling settype() on it throw an exception.
        Hide
        ivaynberg Igor Vaynberg added a comment -

        thought about it some more. the only clear way i see to make this better is to make settype() throw an exception when called on a component that uses an ichoicerenderer.

        Show
        ivaynberg Igor Vaynberg added a comment - thought about it some more. the only clear way i see to make this better is to make settype() throw an exception when called on a component that uses an ichoicerenderer.

          People

          • Assignee:
            ivaynberg Igor Vaynberg
            Reporter:
            pedrosans Pedro Santos
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development