• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring MVC Noob question: Heirarchical edit/view flow?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to set up an MVC controller that will initialize the underlying command ONLY when a new form is displayed.

Basically, the user arrives at the "edit" page for an image gallery by specifying a request parameter like "galleryId". Within the page, I have a bunch of filters the user can set using SELECT lists, etc. These controls are bound to the underlying command, but the list of images being displayed as a result of the command is just placed in the request attributes by the controller.

So I want the controller to initialize the command when it sees a request for a new form, and initialize the image list based on the value of the "galleryId" parameter. On subsequent post-backs (such as when the user filters the list of images by submitting the underlying command), I want the controller to take the existing command, and "re-generate" the image list.

I'm trying to use a combination of formBackingObject, to initialize the command when a new form is requested, and onSubmit(request, response, Object, BindException) when the user submits a filter parameter on subsequent post-backs. But formBackingObject is called on every request, so this approach is not working at all.

How the heck can I do this? I know it seems like the most basic question, but every Spring MVC tutorial I can google seems to deal with Kindergarten-level application examples, and none of them has any kind of parallel to this functionality (select a gallery from a list, proceed to a "view" page for the gallery, filter the "gallery view", proceed to a "view" page for an image, etc. Basic hierarchical stuff).

Please help!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic