Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

example for ImageButtonBean using DispatchAction class

 
sreenivas jeenor
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.


Thanks
Sreenivas
 
Merrill Higginson
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic