ICEfaces
  1. ICEfaces
  2. ICE-6328

Support "icecore:singleSubmit" tag with ICEfaces Advanced Components

    Details

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

      Description

      The ICEfaces Advanced Comps (ace) should support the use of the <icecore:singleSubmit> tag. Using the "icecore:singleSubmit" tag can be viewed as a nice convenience, an easier way to indicate that all components inside a region should adopt singleSubmit behaviour, without having to specify "singleSubmit=true" on each component individually.

      In the case of the ace components, placing inside a <icecore:singleSubmit> region on the page should have the effect of setting all the ace components "singleSubmit" attributes to "true". This approach will ensure that the ace component behaviour inside a singleSubmit region will be identical to that when their "singleSubmit" attribute is set to true.

      This will require:

      1. A mechanism for the ace component renderers to know if they are inside a singleSubmit region, so they can set their singleSubmit attributes accordingly (if not already defined by the application).

      2. A way to ensure that the ace component events do not trigger the default "icecore:singleSubmit" tag submit behaviour based on event bubbling.

        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]
        Assignee Priority P1
        Assignee Ted Goddard [ ted.goddard ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #23364 Tue Dec 07 14:49:54 MST 2010 ted.goddard withinSingleSubmit detection (ICE-6328)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/util/Util.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/renderkit/html_basic/SingleSubmitRenderer.java
        Hide
        Ted Goddard added a comment -

        Method added to org.icefaces.impl.util.Util:

        public static boolean withinSingleSubmit(UIComponent component)

        Individual components need to call this at render time to determine their singleSubmit state.

        Note that the current implementation does not support subtree rendering because the SingleSubmitRenderer adds an attribute to the parent component and uses the detection of that attribute to return the boolean value. This must be implemented at the TagHandler level, likely with a mechanism similar to the mojarra AjaxHandler, to support subtree rendering.

        Show
        Ted Goddard added a comment - Method added to org.icefaces.impl.util.Util: public static boolean withinSingleSubmit(UIComponent component) Individual components need to call this at render time to determine their singleSubmit state. Note that the current implementation does not support subtree rendering because the SingleSubmitRenderer adds an attribute to the parent component and uses the detection of that attribute to return the boolean value. This must be implemented at the TagHandler level, likely with a mechanism similar to the mojarra AjaxHandler, to support subtree rendering.
        Hide
        Ted Goddard added a comment -

        The mechanism is provided, however new JIRAs should be created to enhance for subtree rendering. Individual component JIRAs will be necessary to implement singleSubmit detection.

        Show
        Ted Goddard added a comment - The mechanism is provided, however new JIRAs should be created to enhance for subtree rendering. Individual component JIRAs will be necessary to implement singleSubmit detection.
        Ted Goddard made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        Need adapt the technique used by the compat components in the gettor for partialSubmit property where they check to see if the partialSubmit is being specified in the form and use that as the default value for the partialSubmit attribute. Note that any user-specified value for singleSubmit attribute on the component must override this default value.

        Implementing this will require overriding the generator-created gettor for singleSubmit attribute with a concrete impl. in the component base class.

        Show
        Ken Fyten added a comment - Need adapt the technique used by the compat components in the gettor for partialSubmit property where they check to see if the partialSubmit is being specified in the form and use that as the default value for the partialSubmit attribute. Note that any user-specified value for singleSubmit attribute on the component must override this default value. Implementing this will require overriding the generator-created gettor for singleSubmit attribute with a concrete impl. in the component base class.
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Ted Goddard [ ted.goddard ] Yip Ng [ yip.ng ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        yip.ng made changes -
        Attachment screenshot-01.png [ 12751 ]
        Hide
        yip.ng added a comment - - edited

        Overriding generated getter will produce code as shown in screenshot 1. Not good. Too many lines copied from super class. (It's almost like inserting withinSingleSubmit() as the last line of the generated getter.) This has to be done for every component. And what if the generated code started to change?

        Show
        yip.ng added a comment - - edited Overriding generated getter will produce code as shown in screenshot 1. Not good. Too many lines copied from super class. (It's almost like inserting withinSingleSubmit() as the last line of the generated getter.) This has to be done for every component. And what if the generated code started to change?
        Hide
        Ted Goddard added a comment -

        Something similar to the following might allow the component to incorporate this into a utility method:

        public boolean superValueIfSet(UIComponent component, String attName, boolean superValue, boolean defaultValue) {
        ValueExpression ve = component.getValueExpression(attName);
        if (ve != null)

        { return superValue; }

        ......
        return defaultValue
        }

        public boolean isSingleSubmit()

        { return Util.superValueIfSet(this, PropertyKeys.singleSubmit.name(), super.isSingleSubmit(), Util.withinSingleSubmit(this)); }
        Show
        Ted Goddard added a comment - Something similar to the following might allow the component to incorporate this into a utility method: public boolean superValueIfSet(UIComponent component, String attName, boolean superValue, boolean defaultValue) { ValueExpression ve = component.getValueExpression(attName); if (ve != null) { return superValue; } ...... return defaultValue } public boolean isSingleSubmit() { return Util.superValueIfSet(this, PropertyKeys.singleSubmit.name(), super.isSingleSubmit(), Util.withinSingleSubmit(this)); }
        Hide
        yip.ng added a comment -

        Need to pass state helper in as well because getStateHelper() is protected.

        Show
        yip.ng added a comment - Need to pass state helper in as well because getStateHelper() is protected.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #23447 Fri Dec 10 11:19:12 MST 2010 yip.ng ICE-6328: Support "icecore:singleSubmit" tag with ICEfaces Advanced Components.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/utils/Utils.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/checkboxbutton/CheckboxButton.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/pushbutton/PushButton.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/linkbutton/LinkButton.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/tab/TabSet.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/datetimeentry/DateTimeEntry.java
        Hide
        yip.ng added a comment -

        Revision: 23447


        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/checkboxbutton/CheckboxButton.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/datetimeentry/DateTimeEntry.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/linkbutton/LinkButton.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/pushbutton/PushButton.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/tab/TabSet.java
        Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/utils/Utils.java

        Show
        yip.ng added a comment - Revision: 23447 Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/checkboxbutton/CheckboxButton.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/datetimeentry/DateTimeEntry.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/linkbutton/LinkButton.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/pushbutton/PushButton.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/sliderentry/SliderEntry.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/tab/TabSet.java Modified : /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/utils/Utils.java
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1

          People

          • Assignee:
            yip.ng
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: