Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic