-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.6.0-HF16
-
Fix Version/s: 5.6.0-HF17, 5.7.1
-
Component/s: Seam / JSF UI
Under WebKit the load can not be used because it may be filed a little bit too early (load is completed on the client side but not the server side).
The current DnD code does a workaround using 2 tricks :
- use progress event : 100% => means completed
- track state change
When files are big, the last progress event may be 99.9999% but there is usually no notfication on progress for completion.
This means we have to rely on "state change".
However, there is currently a closure issue in the way the onreadystatechange callback is defined.
Initial code : the closure on xhr is not done correctly
xhr.onreadystatechange = function() {readyStateChange(xhr, opts)}
Modified code : force closure to be sure the call backs will contain the correct values
xhr.onreadystatechange = (function(xhr,opts) { return function() {readyStateChange(xhr, opts)}})(xhr,opts);
NB : JavaScript is such a nice language ...