Trails
  1. Trails
  2. TRAILS-160

Search for Enums throws a class cast exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1, 1.1.2, 1.2.0
    • Fix Version/s: 1.2.1
    • Component/s: trails-hibernate
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Trails does no support searching for enums, and throws a class cast exception when searching on an entity that has one.

      See the simple example, list apples and go to the search form. No matter what you enter in the Origin field, it throws the class cast exception.

      Attached a patch that adds a new component called EnumSearchField, and a new search block in the SearchBlocks page named enumSearch. It also adds the corresponding mapping in the searchBlockFinder spring bean. This component renders the search field as a drop down with a default None option as an empty string, and all the enum components.

      I also changed the AssociationSearchField component to allow for None in the search form.

      I don't know how to test components, so I did not add any unit test (no java code was touched).

      thanks a lot

        Issue Links

          Activity

          Hide
          Alejandro Scandroli added a comment -

          I've applied the patch provided, I've propagated the changes to the archetypes and to all the examples and I've created a functional test for it. See changeset 946.

          Show
          Alejandro Scandroli added a comment - I've applied the patch provided, I've propagated the changes to the archetypes and to all the examples and I've created a functional test for it. See changeset 946.

            People

            • Assignee:
              Alejandro Scandroli
              Reporter:
              Pablo Graņa
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: