Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Multiple image buttons on a Struts Form

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Thanks for any help or suggestion in advance.

I have A form in which there are two buttons in the form of images


<html:image src="images/buttons/submit.gif" alt="" property="method" value="button.addPatientInfo"/>

<html:image src="images/buttons/review.gif" alt="" property="method" value="button.reviewPatientInfo"/>


I want it to function in the following manner.

When a user clicks submit.gif button I want the form to be submitted to a action called SubmitPatientInformation.Here it shud call Add method in the action class.

When the user clicks review I want the form to be submitted to a action called SubmitPatientInformation.Here it shud call a review method in the same action class.


I have extended my action class from DispatchAction.

Please can anyone tell me how this is to be done.

If there is any other way please explain to me.
Some code might help

Thanks all once again
With Regards
Adrian.
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use LookupDispatch action instead of Dispatch.
or add an onClick attribute to the button, which calls a javascript function.

both these methods are described by Ted Husted below:

ted husted struts tips
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic