• 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

cancel button with dispatchAction

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the apache site it says:
Cancel handlers - DispatchAction, LookupDispatchAction, and MappingDispatchAction - Now provide default cancel handler that can be overridden. It also also possible to specify the default handler name.

HOW???


I'm trying to have a cancel button on a form that works with dispatchAction.

sturts-config.xml:


When I 'plug' my button on the jsp page:



I get the error message:


HTTP Status 400 - Request[/GroupTravelerList] does not contain handler parameter named operation

type Status report

message Request[/GroupTravelerList] does not contain handler parameter named operation

description The request sent by the client was syntactically incorrect (Request[/GroupTravelerList] does not contain handler parameter named operation).

 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method to handle a cancel button is "cancelled". (see the javadoc). You need to overrride that method and include whatever logic you want executed when the cancel button is pressed.

It also appears that you may have to send some value in the "operation" parameter since that is the declared handler parameter. Adding an onclick event to the button might do the trick. Something like this:

onklick="this.form.action += '?operation=dummy';"
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, I managed to invoke the cancelled as explained. I'm using this:



Q: I've tried to 'convert' this button into an image but couldn't figure it out how

thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic