Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2990

JSP views for finders that search collections do not add candidate entities to the UI model

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.2.0.RELEASE
    • Fix Version/s: 1.2.1.RELEASE
    • Component/s: WEB MVC
    • Labels:
      None

      Description

      1. Run the embedded clinic.roo script.
      2. Add a finder as follows (querying a Set-based field):
        finder add --class ~.domain.Owner --finderName findOwnersByPets
        web mvc finder all
      3. Run the application using for example mvn jetty:run.
      4. Add one or more Pets (don't need an Owner).
      5. In the menu, click "Owner -> Find by Pets"
      6. The displayed finder form says "No Pets found. ( required )" instead of offering the Pet(s) added above.

      This bug was possibly introduced by the changes for ROO-2514. The fix is to explicitly populate the model in the scaffolded finder handling method:

      "OwnerController_Roo_Controller_Finder.aj"
      @RequestMapping(params = { "find=ByPets", "form" }, method = RequestMethod.GET)
      public String OwnerController.findOwnersByPetsForm(Model uiModel) {
          	uiModel.addAttribute("pets", Pet.findAllPets()); // <== added line
              return "owners/findOwnersByPets";
      }

        Attachments

          Activity

            People

            Assignee:
            aswan Andrew Swan
            Reporter:
            aswan Andrew Swan
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: