• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

example for ImageButtonBean using DispatchAction class

Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I want an example where a Jsp page has multiple image buttons and each button calling the same dispatchAction.

i am able to do call dispatchAction class in the follwing manner in the jsp page..
<html:hidden property="go" value="error"/>
<SCRIPT>function set(target) {document.forms[0].go.value=target;}</SCRIPT>
<html:submit onKlick="set('save');">SAVE</html:submit>
<html:submit onKlick="set('create');">SAVE AS NEW</html:submit>
<html:submit onKlick="set('delete);">DELETE</html:submit>

what i want is ,I want use ImageButton Bean class to call appropriate method in DispatchAction class.

Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid the ImageButtonBean doesn't really fit the pattern needed by DispatchAction very well. With the ImageButtonBean, you need a separate property for each button, while Dispatch action was made to work with a single property having multiple values.

Since you've already got working code using JavaScript, my suggestion would be just to keep the same pattern and use the onclick event of the html:image tag to set the value of the governing property for your DispatchAction.
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic