3

I am not clear on the difference between these two methods. I see that the actionListener takes an ActionEvent as a parameter, but both may be tied to a method in the backing bean.

Is the only functional difference the ActionEvent parameter? So if I need ActionEvent use the listener method, if not, either will work?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
bmw0128
  • 13,470
  • 24
  • 68
  • 116
  • 1
    I think the title of this question should be "Action vs actionListener" since this seems to have nothing to do with ICEFaces. Thanks for the info. – Jon Onstott Jan 29 '10 at 22:30

1 Answers1

6

actionListener takes an ActionEvent as the Parameter and returns void. Action takes no parameters and returns a String which can be used for navigation.

If you don't need the ActionEvent, and don't need to navigate, you can generally do either one. If you do need the ActionEvent, you need actionListener. If you do need to navigate, then you need the action.

jsight
  • 27,819
  • 25
  • 107
  • 140