• Post Reply Bookmark Topic Watch Topic
  • New Topic

Req: ActionListener Example  RSS feed

 
Matt DeC
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been reading core JSF by David Geary. In chaper 7, he discusses Action Listeners. The example he uses to illustrate an actionListener is an Image Map. In his example - The listener needs to tell JSF the coordinates of the image map to determine the action (i.e. which page to navigate). This is done because the action doesn't know about the UI (i.e the image map).

To get a better understanding of ActionListerers, can anyone provide other examples where you would use an ActionListener? Other than Geary's example, I can't think of other uses of ActionListerers. Because I can't think of other uses, I'm concerned I'm missing something about them.

thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The simplest way to think about is Action Listeners are used when you don't need to navigate to another page. So, some action occurs and the same page is displayed again, probably showing updated data.

One example that comes to mind is while displaying a data table you might want to edit/update/delete/insert a new row. All these can be done using an ActionListener on associated button(s) and never needing to navigate away from the page that contains the data table. As each action event completes, the table is redrawn with it's updated rows.
 
Matt DeC
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

Now I understand why I would use one over the other. Exactly what I was looking for!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!