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

        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.
        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.
        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.
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: