Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2-EE-GA
-
Fix Version/s: 1.8.3, 1.8.2-EE-GA_P02
-
Component/s: ICE-Components
-
Labels:None
-
Environment:-
-
Workaround Exists:Yes
-
Workaround Description:Apply any application logic for pre-upload when postUpload equals false
Description
When using the inputFile's autoUpload and submitOnUpload="preAndPostUpload" features along with synchronous mode set to true, the preUpload submit does not occur. The attached test case demonstrates that both pre and post lifecycles fire but the preUpload value on the first iteration is false. The second iteration is correct with postUpload set to true.
O'Reilly JavaScript: The Definitive Guide v1.2 book states the following in regards to form.submit():
The one important difference between the submit() method and form submission by the user is that the onsubmit() event handler is not invoked when submit() is called. If you use onsubmit() to perform input validation, for example, you'll have to do that validation explicitly before calling submit().
Basically, we need our autoUpload code to directly invoke our onsubmit code before calling submit.