2 Replies Latest reply on May 18, 2010 11:09 AM by Ilya Shaikovsky

    Should a4j:ajax behavior act as ActionSource? (RF-7827)

    Ilya Shaikovsky Master

      From the very beginning a4j:support had action/actionListener attributes. Support populated ActionEvent and was designed to allow navigation cases also. As I guess it was mainly caused by the fact that JSF 1.2 do not have ajax standartized and there was limitations of combining ajax functionality which came from a4j:support with standard/third-party action components. But now the JSF 2 specification declares Behaviors and BehaviorEvent which processed by corresponding listener.

       

      So the question - do we still really want a4j:ajax to act as ActionSoruce also? Do we really want to allow action/actionListener definitions at the behavior itself?

       

      My opinion that action attributes should be defined at command* components to which this behavior is attached only. And it could be overhead if the developer will be allowed to wrap some subtree with a4j:ajax with some action and in the subtree there will be some commandButton with action also. Which component navigation case should be used there? And in general I think to define submitting behavior as ActionSource now not looks native according to JSF 2 spec.

       

      WDYT? Now we will postpone the RF-7827 at least untill that discussion will be finished. Then it will be canceled or assigned.

        • 1. Re: Should a4j:ajax behavior act as ActionSource? (RF-7827)
          Alexander Smirnov Master

          a4j:support has been made as ActionSource to support particular use case: perform navigations on AJAX requests. Using only action component properties seems not enough because it can be used with non-action components like SelectOneMenu or even layout components like tables or panels ( onrowmouseclick in the table, for example ).

          I think that feature makes sense for JSF 2.0 behavior also. It also would be helpful for migration from RF 3.x to 4.0

          P.S. With behaviors, I even thought about some kind of "submit" one that can submit form on particular event and lets developer to use standard navigation on non-command components. Such behavior would be complimentary for a4j:support.

          • 2. Re: Should a4j:ajax behavior act as ActionSource? (RF-7827)
            Ilya Shaikovsky Master
            a4j:support has been made as ActionSource to support particular use case: perform navigations on AJAX requests.

            but support was much limited (redirect or using a4j:include)

             

            And mainly the guys just put their business logic on entered values processing to action.

             

            Using only action component properties seems not enough because it can be used with non-action components like SelectOneMenu or even layout components like tables or panels ( onrowmouseclick in the table, for example ).

            It's not really convenient but possible for now also by using navigation handler directly in ajax listener.

             

            P.S. With behaviors, I even thought about some kind of "submit" one that can submit form on particular event and lets developer to use standard navigation on non-command components. Such behavior would be complimentary for a4j:support.

            So maybe create separate "action" behavior which will have two modes and will be designed for navigation?

             

            P.S. I'm not completelly against but just wants to get all your opinions - if this additional functionality looks native for just ajax submission behavior