5 Replies Latest reply on Jan 17, 2008 4:33 AM by Nicklas Karlsson

    actionListener vs action and redirect

    Daniel Kane Novice

      Dear colleagues,

      I always used actionListener parameter when bind component method to a:commandLink. It was ok until I needed the event that not only trigger action but also redirect to another page.
      I added redirect rule to pages.xml and specified action in it. But a:commandLink with actionListener worked only partially : action was performed without redirect. When I change actionListener to action, both method and redirect works well.
      Now I want to understand the difference between those to attributes, when to use 1st and when 2nd. I don't understand this difference from standard manuals saying :

      actionListener : MethodBinding pointing at method accepting an ActionEvent with return type void


      action : MethodBinding pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property


      Could anyone provide more human readable explanation please ?
      TIA.