ICEfaces
  1. ICEfaces
  2. ICE-5880

New icecore:singleSubmit tag to set singleSubmit default value for all input components in the form

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Sparkle Component Platform
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      In ICEfaces 1.x, we have an <ice:form> component with a "partialSubmit=true/false" attribute that can be used to set the default partialSubmit behavior for all ice: components in the form, as a convenience vs. setting the individual partialSubmit attributes on each component.

      We need a solution to provide the same capability for the new Sparkle components. As we do not want to simply provide our own "ice:form" component in order to preserve 3rd party component compatibility, a likely alternative seems to be to provide a component that can be used as a sub-component of the standard JSF <h:form> component instead.

      e.g.

      <h:form>
         <ice:partialSubmit default="true">
         <ice:tabPane>
         ...
      </h:form>



        Issue Links

          Activity

          Ken Fyten created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Salesforce Case []
          Fix Version/s 2.0.0 [ 10230 ]
          Affects [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration]
          Ken Fyten made changes -
          Link This issue blocks ICE-5720 [ ICE-5720 ]
          Hide
          Neil Griffin added a comment -

          First I think we need to talk about what "partial submit" meant in ICEfaces 1.x, and what "partial submit" means in ICEfaces 2.0.

          In ICEfaces 1.x, the term "partial submit" actually meant a FULL submit, with PARTIAL validation. All the EditableValueHolder fields in the form are serialized and submitted to the server via XmlHttpRequest. But only the fields that had been visited by the user were validated in the PROCESS_VALIDATIONS phase of the JSF lifecycle.

          In ICEfaces 2.0, the term "partial submit" actually means a PARTIAL submit with PARTIAL validation. For example, if you use the ICEfaces 2.0 JavaScript API and place include onblur="ice.se('onblur', this)" on an h:inputText, then the "se" means "Single Element" and so the XmlHttpRequest contains only the value of the h:inputText field. See http://wiki.icefaces.org/display/ICE/JavaScript+Client+API

          Now, in both ICEfaces 1.x and 2.0, triggering the XmlHttpRequest causes the ICEfaces Direct2DOM server-side DOM-diff engine to compute the differences, and sends back minimal page updates to the browser's DOM.

          In order to understand the requirement in ICEfaces 2.0, I think it will be helpful to review two different scenarios:

          1) ICEfaces 2.0 + h:form + icefaces-compat.jar

          Developers in this scenario are either a) experienced with the ICEfaces 1.8 component suite or b) migrating existing apps to ICEfaces 2.0. They're probably not worried about transitive dependencies like commons-beanutils, commons-collections, commons-digester, commons-fileupload, and commongs-logging. They're definitely going to use the compat components. Maybe they'll use Sparkle components, maybe not. They're probably willing to switch from ice:form to h:form, but they're used to "partial submit" meaning that all the fields are sent in the XmlHttpRequest, and not just one. They need a convenient way to turn this feature on for the h:form, that's all.

          2) ICEfaces 2.0 + h:form

          Developers in this scenario are likely creating new applications, and not migrating. Perhaps they will add Sparkle components, and perhaps components from another component suite too. They might indeed be worried about transitive dependencies, and so they would I think shy-away from including icefaces-compat.jar in their projects. Perhaps they want to use ICEpush. And maybe even use ICEpush to provide server-initiated updates for components from other suites.

          IDEAS:

          1. Currently in ICEfaces 2.0 I think the h:form is being "decorated" in the sense that a SystemEvent is used to do some rendering magic to get the form to be submitted via XmlHttpRequest rather than a full postback. Perhaps the presence of <ice:partialSubmit /> as a child of h:form would cause this type of decoration on all EditableValueHolder components that can support onblur.

          2. Another approach might be with JSF 2.0 Behaviors on individual components. See Dan Allen's blog here:
          http://java.dzone.com/articles/jsf-2-client-behaviors

          Using behaviors, instead of doing this:

          <h:inputText id="foo" onblur="ice.se('onblur', this)" required="true" value="#

          {modelBean.foo}" />

          We could do this:

          <h:inputText id="foo" required="true" value="#{modelBean.foo}

          ">
          <ice:partialSubmit />
          </h:inputText>

          And this could decorate the h:inputText with an onblur handler automatically in the rendered HTML.

          Whatever we do, I think it is important to be able to trigger ICEfaces 2.0 Direct2DOM rendering without writing any JavaScript in the Facelet view.

          Show
          Neil Griffin added a comment - First I think we need to talk about what "partial submit" meant in ICEfaces 1.x, and what "partial submit" means in ICEfaces 2.0. In ICEfaces 1.x, the term "partial submit" actually meant a FULL submit, with PARTIAL validation. All the EditableValueHolder fields in the form are serialized and submitted to the server via XmlHttpRequest. But only the fields that had been visited by the user were validated in the PROCESS_VALIDATIONS phase of the JSF lifecycle. In ICEfaces 2.0, the term "partial submit" actually means a PARTIAL submit with PARTIAL validation. For example, if you use the ICEfaces 2.0 JavaScript API and place include onblur="ice.se('onblur', this)" on an h:inputText, then the "se" means "Single Element" and so the XmlHttpRequest contains only the value of the h:inputText field. See http://wiki.icefaces.org/display/ICE/JavaScript+Client+API Now, in both ICEfaces 1.x and 2.0, triggering the XmlHttpRequest causes the ICEfaces Direct2DOM server-side DOM-diff engine to compute the differences, and sends back minimal page updates to the browser's DOM. In order to understand the requirement in ICEfaces 2.0, I think it will be helpful to review two different scenarios: 1) ICEfaces 2.0 + h:form + icefaces-compat.jar Developers in this scenario are either a) experienced with the ICEfaces 1.8 component suite or b) migrating existing apps to ICEfaces 2.0. They're probably not worried about transitive dependencies like commons-beanutils, commons-collections, commons-digester, commons-fileupload, and commongs-logging. They're definitely going to use the compat components. Maybe they'll use Sparkle components, maybe not. They're probably willing to switch from ice:form to h:form, but they're used to "partial submit" meaning that all the fields are sent in the XmlHttpRequest, and not just one. They need a convenient way to turn this feature on for the h:form, that's all. 2) ICEfaces 2.0 + h:form Developers in this scenario are likely creating new applications, and not migrating. Perhaps they will add Sparkle components, and perhaps components from another component suite too. They might indeed be worried about transitive dependencies, and so they would I think shy-away from including icefaces-compat.jar in their projects. Perhaps they want to use ICEpush. And maybe even use ICEpush to provide server-initiated updates for components from other suites. IDEAS: 1. Currently in ICEfaces 2.0 I think the h:form is being "decorated" in the sense that a SystemEvent is used to do some rendering magic to get the form to be submitted via XmlHttpRequest rather than a full postback. Perhaps the presence of <ice:partialSubmit /> as a child of h:form would cause this type of decoration on all EditableValueHolder components that can support onblur. 2. Another approach might be with JSF 2.0 Behaviors on individual components. See Dan Allen's blog here: http://java.dzone.com/articles/jsf-2-client-behaviors Using behaviors, instead of doing this: <h:inputText id="foo" onblur="ice.se('onblur', this)" required="true" value="# {modelBean.foo}" /> We could do this: <h:inputText id="foo" required="true" value="#{modelBean.foo} "> <ice:partialSubmit /> </h:inputText> And this could decorate the h:inputText with an onblur handler automatically in the rendered HTML. Whatever we do, I think it is important to be able to trigger ICEfaces 2.0 Direct2DOM rendering without writing any JavaScript in the Facelet view.
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 2.0-Beta2 [ 10242 ]
          Fix Version/s 2.0.0 [ 10230 ]
          Assignee Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          It may be possible to use event bubbling with onblur or onchange events to provide this feature for standard components.

          Show
          Ted Goddard added a comment - It may be possible to use event bubbling with onblur or onchange events to provide this feature for standard components.
          Hide
          Ted Goddard added a comment -

          As Deryk found in this reference, it may be difficult to bubble:

          http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html

          Show
          Ted Goddard added a comment - As Deryk found in this reference, it may be difficult to bubble: http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
          Hide
          Ted Goddard added a comment -

          Example showing "onblur" equivalent working with bubbling.

          Show
          Ted Goddard added a comment - Example showing "onblur" equivalent working with bubbling.
          Ted Goddard made changes -
          Attachment bubbletest.html [ 12587 ]
          Hide
          Ted Goddard added a comment -

          It is possible to implement a bubbling form of "onblur" (attached HTML document). This will allow us to add partialSubmit onblur behavior in an efficient manner (without adding event handlers to each element).

          Show
          Ted Goddard added a comment - It is possible to implement a bubbling form of "onblur" (attached HTML document). This will allow us to add partialSubmit onblur behavior in an efficient manner (without adding event handlers to each element).
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #22483 Fri Oct 01 10:29:44 MDT 2010 ted.goddard initial ice:partialSubmit flag component (ICE-5880)
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/core.taglib.xml
          Commit graph ADD /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/html_basic/PartialSubmitRenderer.java
          Hide
          Ted Goddard added a comment -

          Initial ice:partialSubmit component checked in:

          <h:form id="form1" prependId="false">
          <ice:partialSubmit rendered="true" />

          Tested with a text field. Testing is required for all input types on all browsers.

          Show
          Ted Goddard added a comment - Initial ice:partialSubmit component checked in: <h:form id="form1" prependId="false"> <ice:partialSubmit rendered="true" /> Tested with a text field. Testing is required for all input types on all browsers.
          Hide
          Ted Goddard added a comment -

          Component is checked in. Create new JIRAs for specific bugs.

          Show
          Ted Goddard added a comment - Component is checked in. Create new JIRAs for specific bugs.
          Ted Goddard made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Salesforce Case []
          Security Private [ 10001 ]
          Hide
          Ted Goddard added a comment -

          Should rename to ice:singleSubmit

          Show
          Ted Goddard added a comment - Should rename to ice:singleSubmit
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #22615 Wed Oct 13 14:30:22 MDT 2010 ted.goddard renamed to singleSubmit (ICE-5880)
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
          Commit graph ADD /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/html_basic/SingleSubmitRenderer.java
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/core.taglib.xml
          Commit graph DEL /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/html_basic/PartialSubmitRenderer.java
          Hide
          Ken Fyten added a comment -

          Needs to be renamed to singleSubmit.

          Show
          Ken Fyten added a comment - Needs to be renamed to singleSubmit.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P2
          Hide
          Ted Goddard added a comment -

          Tag renamed.

          Show
          Ted Goddard added a comment - Tag renamed.
          Ted Goddard made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ted Goddard made changes -
          Summary Sparkle: New <h:form> subcomponent to set partialSubmit default value for comps. in form Sparkle: New <h:form> subcomponent to set singleSubmit default value for comps. in form
          Salesforce Case []
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #22641 Fri Oct 15 08:33:02 MDT 2010 ted.goddard clearing focus upon singleSubmit (ICE-5880)
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/application.js
          Ken Fyten made changes -
          Summary Sparkle: New <h:form> subcomponent to set singleSubmit default value for comps. in form New icecore:singleSubmit tag to set singleSubmit default value for all input components in the form
          Salesforce Case []
          Component/s Framework [ 10013 ]
          Component/s Components [ 10012 ]
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2

            People

            • Assignee:
              Ted Goddard
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: