ICEfaces
  1. ICEfaces
  2. ICE-8575

icecore:singleSubmit submitOnBlur not submitting on blur

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, EE-3.0.0.GA_P01, 3.2.BETA1
    • Fix Version/s: 3.2
    • Component/s: Framework, ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description


      Setting the <icecore:singleSubmit submitOnBlur="true"/> for the form no longer submits the form on blur of an inputText field. It will only submit on change of the input field.


        Activity

        Hide
        Arran Mccullough added a comment - - edited

        Attached test case that shows the issue.

        Steps:

        • Load welcomeICEfaces.jsf
        • Focus into one of the inputText fields and focus out. No submit is seen in the browser console.
        • Enter in some text into the an input field and tab/click out, an update is now executed.
        Show
        Arran Mccullough added a comment - - edited Attached test case that shows the issue. Steps: Load welcomeICEfaces.jsf Focus into one of the inputText fields and focus out. No submit is seen in the browser console. Enter in some text into the an input field and tab/click out, an update is now executed.
        Hide
        Deryk Sinotte added a comment - - edited

        I'll have to find a release where this did work because my current testing is showing that there are no "blur" events even being sent to the function that handles singleSubmit. I see that the event listeners for blur and change are both registered:
        if (f.addEventListener) {
        //events for most browsers
        f.addEventListener('blur', submitForm, false);
        f.addEventListener('change', submitForm, false);
        But no corresponding blur event ever seems to trigger this function, no matter what submitOnBlur is set to.

        Show
        Deryk Sinotte added a comment - - edited I'll have to find a release where this did work because my current testing is showing that there are no "blur" events even being sent to the function that handles singleSubmit. I see that the event listeners for blur and change are both registered: if (f.addEventListener) { //events for most browsers f.addEventListener('blur', submitForm, false); f.addEventListener('change', submitForm, false); But no corresponding blur event ever seems to trigger this function, no matter what submitOnBlur is set to.
        Hide
        Deryk Sinotte added a comment - - edited

        With submitOnBlur, we default to not doing an automatic submission during a blur for text type elements. The logic is that, if nothing is changed, then blur shouldn't trigger a submission. There are a couple of issues with this:
        1) Right now, setting submitOnBlur=true appears to do nothing. It seems that the registration of the event:
        f.addEventListener('blur', submitForm, false);
        actually needs to be:
        f.addEventListener('blur', submitForm, true);
        Note the 3rd parameter changes from true to false. This is for indicating that you want that event to "useCapture". By switching it to true, I now see the blur event running in the relevant code block.
        2) Now that blur is actually activated, both change and blur will now cause submits when submitOnBlur=true unless we add more logic to deal with that.
        3) Since IE 7/8 is relying on focusout for certain use cases to do the submit, the submitOnBlur setting doesn't make much sense as turning it off would mean that nothing gets submitted. So we what we do is use the focusout event to check if anything is changed but only when submitOnBlur=false. When submitOnBlur=true, don't check for changes, just submit.

        Show
        Deryk Sinotte added a comment - - edited With submitOnBlur, we default to not doing an automatic submission during a blur for text type elements. The logic is that, if nothing is changed, then blur shouldn't trigger a submission. There are a couple of issues with this: 1) Right now, setting submitOnBlur=true appears to do nothing. It seems that the registration of the event: f.addEventListener('blur', submitForm, false); actually needs to be: f.addEventListener('blur', submitForm, true); Note the 3rd parameter changes from true to false. This is for indicating that you want that event to "useCapture". By switching it to true, I now see the blur event running in the relevant code block. 2) Now that blur is actually activated, both change and blur will now cause submits when submitOnBlur=true unless we add more logic to deal with that. 3) Since IE 7/8 is relying on focusout for certain use cases to do the submit, the submitOnBlur setting doesn't make much sense as turning it off would mean that nothing gets submitted. So we what we do is use the focusout event to check if anything is changed but only when submitOnBlur=false. When submitOnBlur=true, don't check for changes, just submit.
        Hide
        Deryk Sinotte added a comment - - edited

        I ran the test case from ICE-8389 and saw the problem that was originally described. I then ran the case against the changes I've made and I don't see the problem with submitOnBlur = true or false. So I'm resolving this as fixed.

        Show
        Deryk Sinotte added a comment - - edited I ran the test case from ICE-8389 and saw the problem that was originally described. I then ran the case against the changes I've made and I don't see the problem with submitOnBlur = true or false. So I'm resolving this as fixed.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: