3 Replies Latest reply on Nov 26, 2008 12:38 PM by Kerdudou Ronan

    Enhancing commands to support new JSF 2.0 capabilities

    Vladimir Kovalyuk Apprentice

      I like the idea of the following use case of command component:

      <h:commandbutton id="submit" value="submit"
      onclick="javax.faces.ajax.ajaxRequest(this, event,
      {execute:'submit',render:'outtext'}); return false;" />
      


      I suggest enhancing a4j:commandButton in following aspects:
      1. add regular (non-ajax mode)
      2. capability to send components listed in 'execute' attribute only in non-ajax mode
      3. capability to re-render components listed in render attribute in ajax mode
      4. ability to execute command outside of the form
      5. introduce component which would combine inner components when listed in 'execute' attribute.

      The latter means that it doesn't matter where input components are placed. In order to execute command in regular mode it uses hidden form and dynamically fill it with components' date whose ids listed in 'execute' attribute.

      I believe it would be step forward in designing sophisticated UI. For now it's difficult to make good composition of reusable parts using Facelet's templating capabilities and split page to forms. One example - usually list of Seam conversations is put into separate form and data the user entered before switching conversations are lost when switching happens (validation is another issue, but let's start with solving this very problem).

      Generally speaking form is HTML thing and intention to abtract JSF from user-agent still remains intention. Ability to specify what particularly we would like to send will allow to give up using forms in design (where it make sense).

      That would have one side effect - attribute "immediate" would become absolete.

      P.S. Actually it should be JSF proposal. I have already sent one.