File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes example for ImageButtonBean using DispatchAction class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "example for ImageButtonBean using DispatchAction class" Watch "example for ImageButtonBean using DispatchAction class" New topic
Author

example for ImageButtonBean using DispatchAction class

sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: example for ImageButtonBean using DispatchAction class