4 Replies Latest reply on Jun 8, 2010 10:29 AM by jbalunas

    default values for execute in commandButton, commandLink

    ilya_shaikovsky

      Guys, want quickly ping you for opinions about to change default executes for that components.

       

      Reason

      ajaxSingle(execute=@this) button used normally as:

      • cancel button
      • navigation button which not considering any additional form info
      • maybe button in table row(edit/delete)

       

      but more common case - button which processed some entered information. In all that simple cases developers will have to use execute="@form" for control. I was alrready confused by the fact that I'm adding the component to form to reflect form changes and see nothing instead (maybe I've just played with 3.3.x too much but normally I think about the commandButton component as about the component that submits whole form)

       

      I realize that submitting behavior for JSF 2 has execute = @this by default. And if the developer will use a4j:ajax with button combination - he will get the same JSF default behavior.

       

      But the command* components - our special ones so I think we could choose reasonable defaults ourselves.

       

      WDYT?

        • 1. Re: default values for execute in commandButton, commandLink
          nbelaevski

          I've created https://jira.jboss.org/browse/RFPL-610 task to discuss this in M1.

          • 2. Re: default values for execute in commandButton, commandLink
            jbalunas

            My concern with changing the default behavior is that user will be expecting spec behavior and could cause issues that are hard to debug, if the default execute is different.

             

            I understand that in most cases command buttons need to execute more than just "@this", but I would recommend working through the spec teams on changing the default instead of changing it ourselves.

             

            I'm open to arguments against this, but I like to maintain user experience where possible, or if we change it, make it cool and obvious.  I'm just not sure this would qualify.

            • 3. Re: default values for execute in commandButton, commandLink
              ilya_shaikovsky
              I understand that in most cases command buttons need to execute more than just "@this", but I would recommend working through the spec teams on changing the default instead of changing it ourselves.

              My main concern that spec provides the default only within f:ajax component. And for the component which designed to ajax'ify standard ones that looks like optimal choise. But still looks questionable for specific components which provide ajax built-in. And I think JSF itself will not provide much additional components as it looks some specific to HTML renderkit so them probably would continue just with f:ajax.

               

              Example from 3.3.x:

              dataScroller, suggestionBox, calendar and so on - has ajaxSingle=true by default. And even considering that a4j:support, commandButton, link and many other components has ajaxSingle=false (actually false value was default for the framework components) - almost nobody was surprised by that and even more - if dataScroller or calendar scrolling had ajaxSingle=false from the beggining(just because false is default) - many question risen because it's pretty unexpected that those components action fires whole form validation. So we changed defaults for such components in the past.

               

              So just wondering - could be expect that the user expectation depends on concrete component? And could we change defaults per-component if it looks more loggically correct for it according to use-cases?

              • 4. Re: default values for execute in commandButton, commandLink
                jbalunas

                You have convinced me :-)

                 

                I think that you are right - with specific components we should use what users will mostly likely use.  a4j:ajax will remain the default, but others can take what valies they need.

                 

                -Jay