GrailsInAction / graina2

Source code for the 2nd edition of Grails in Action
90 stars 92 forks source link

Search query isn't working #2

Open danhyun opened 11 years ago

danhyun commented 11 years ago

The data-binding to the parameter of UserController.result was looking for params.query. As a result, my users object was always size 0. Either we need to update search.gsp to change the name of the textfield from loginId to query or adjust the parameter name in UserController.result to be loginId instead of query. I chose the second because loginId is more consistent with the rest of the app.

pledbrook commented 11 years ago

The code does currently work as the search form specifies a name of query for the search text field. That said, I have linked to this issue from the [Proposed Changes] wiki page, which already has an item for investigating this particular example. Several people have commented on the use of query as the parameter name being confusing, so we may change it to loginId or perhaps searchText.

The only reason I'm hesitant about loginId is that it doesn't have to a be a full login ID.