Results 1 to 3 of 3

Thread: Newbie Q: How implement filter then submit?

  1. #1

    Default Newbie Q: How implement filter then submit?

    I'm very new to Spring so pardon if this question is to vague or basic...

    I'm designing a webpage where the user will be able to view a potentially long list of items. Call this the "summary" view. To help him find the item he's looking for I'll provide a set of inputs, like an date range, for example. After setting the date range, he can hit a "Filter" button, and the view list will be limited to the items within the range. When he's found the item he's looking for, he can select it via a radio button and press a "View" button the view the details of the selected item. Call this the "detailed" view.

    So, I think I should use a SimpleFormController with the formView="summary" and successView="detailed". But my question is this: what is the best way to use Spring to get the view to refresh with the filtered list of items?

    Any help is greatly appreciated! Thanks

  2. #2

    Default

    I'd rather implement your use case as two different controllers.
    The first one should manage the filtering process. When the user wants to proceed to the detailed view, he or she is redirected to the detailed view controller. You can pass the information required by the second controller using POST or GET.

    Notice that this way you can reuse the second controller.

  3. #3
    Join Date
    Feb 2005
    Posts
    217

    Default

    Quote Originally Posted by ChuckAtEmbarq View Post
    To help him find the item he's looking for I'll provide a set of inputs, like an date range, for example. After setting the date range, he can hit a "Filter" button, and the view list will be limited to the items within the range. When he's found the item he's looking for, he can select it via a radio button and press a "View" button the view the details of the selected item. Call this the "detailed" view
    I use POST for "actions" -- filtering in this case isn't really an action so I would do that with a GET. You'll then see items in the URL like "startDate=XXXX&endDate=YYYY" The user might want to bookmark this page so he/she can get back to it easily.

    Likewise they might want to get to the detailed view (and you aren't doing an 'action' on it like ordering more parts) so I would use a GET for that page as well, ie "partNum=1234" in the URL.

    So I would make 2 separate controllers that extend AbstractCommandController.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •