Meaningless Drivel is fun!*
The moose likes Struts and the fly likes how to tell which icon was clicked in the action class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to tell which icon was clicked in the action class?" Watch "how to tell which icon was clicked in the action class?" New topic
Author

how to tell which icon was clicked in the action class?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi there,

To make the site more user friendly I decided to use icons (this is instead of buttons).My code looks like this:



Question, when the user clicks a button and that goes into the Action Class, how can I tell which icon was pressed? (Is there more than one option?)

Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Use the <html:image> tag and specify a property name in the tag. Then create a property of the same name in your ActionForm of type ImageButtonBean. In the execute method of your Action class, call the isSelected() method on this bean. It will return true if the button was clicked, and false if it wasn't.
[ October 22, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
 
subject: how to tell which icon was clicked in the action class?
 
Similar Threads
complete web.xml sample
how to access the <param> in jsp which are set from struts.xml
Forwarding data struts.xml
Redirects in Inceptor
Ajaxstart/Ajaxstop Global Handler Form Reference