Primefaces p:fileUpload doesnt work in IE 10

前端 未结 6 1696
攒了一身酷
攒了一身酷 2021-01-13 03:07

Update attribute and onComplete in p:fileUpload doesnt work in IE10. In IE 9 sizeLimit attribute is ignored. Has anyone came across this situation.

I have tried ca

6条回答
  •  不要未来只要你来
    2021-01-13 03:50

    This is fixed in the new 4.0 Primefaces release, however if you are still on an older version of Primefaces you might still need a workaround.

    I was able to update after a file upload by using the onstart attribute which does still work in IE 10.

    Create a hidden field that contains a value that gets updated as part of the method called from the fileUploadListener. Then set the onstart attribute of the p:fileUpload to something like the following:

    function checkUpload() {
    
        //this should call a p:remoteCommand that refreshes your hidden value
        refreshHiddenValue(); 
    
        var hiddenFieldValue = $('#hiddenFieldId').val();
        if(hiddenFieldValue) {
            //this should call a p:remoteCommand that refreshes the
            //sections you want refreshed after the upload has finished
            refreshSections();
        }
        else {
            setTimeout(checkUpload, 1000);
        } 
    } 
    

提交回复
热议问题