Details
-
Type: Bug
-
Status: Closed
-
Priority: 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.
-
Hide
- Case11619Example.war
- 9.54 MB
- Migration
-
- META-INF/MANIFEST.MF 0.1 kB
- META-INF/context.xml 0.1 kB
- WEB-INF/classes/com/.../example/Item.class 0.3 kB
- WEB-INF/classes/.../example/TestBean.class 0.9 kB
- WEB-INF/lib/commons-beanutils.jar 226 kB
- WEB-INF/lib/commons-collections.jar 558 kB
- WEB-INF/lib/commons-digester.jar 140 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/icefaces-ace.jar 3.09 MB
- WEB-INF/lib/icefaces-compat.jar 2.68 MB
- WEB-INF/lib/icefaces.jar 341 kB
- WEB-INF/lib/javax.faces.jar 2.48 MB
- WEB-INF/web.xml 2 kB
- welcomeICEfaces.xhtml 1 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
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.
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.
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.
Attached test case that shows the issue.
Steps: