• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

SimpleFormController Cancel Button

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm writing a controller that extends simpleformcontroller but since it's a portlet I can't use CancellableFormController. I was wondering if it's possible to get the value of a submit button so when the user clicks on the cancel button I can compare the value and return to a view.

request.getParameter("cancel") is always returning null no matter what.

Thanks.l
 
laura mccord
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, I think the reason why I was getting null for all my request is because I have bindOnNewForm set to true and my parameters are being set in my CommandClass. So, I created a getButton() and setButton() in my commandClass so that I can check which button the user clicked. Then once the onSubmitRender() is executed I compare the value of the button and return to one of my views.

This may be a kludgey solution but it works. However, I'm trying to keep my code compliant with the Spring structure so if there is a better solution I'd be really interested in hearing it.

Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic