Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primefaces p:fileUpload doesnt work in IE 10

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 calling p:remotecommand by using onComplete attribute on p:fileUoload but it looks like even onComplete doesn't work in IE 10

<h:form id="file" enctype="multipart/form-data">
        <p:outputLabel value="Test........"></p:outputLabel>
        <p:fileUpload label="Browse..." description="Select PDF file"
            auto="true" sizeLimit="500000"
            oncomplete="refreshData()"
            onstart="alert('test');" mode="advanced"
            fileUploadListener="#{fileUpload.handleFileUpload}"
            allowTypes="/(\.|\/)(pdf|png)$/">

        </p:fileUpload>
        <p:inputText value="#{fileUpload.test}" id="test" />
        <p:remoteCommand name="refreshData" action="#{fileUpload.setData}"
            update="test"></p:remoteCommand>
    </h:form>
like image 757
KCP Avatar asked Apr 16 '13 12:04

KCP


Video Answer


2 Answers

Finally realized that its a bug in primefaces.

http://forum.primefaces.org/viewtopic.php?f=3&t=28860#p94845

http://code.google.com/p/primefaces/issues/detail?id=5355

Fixed in:

TargetVersion-4.0
TargetVersion-3.5.9

like image 182
KCP Avatar answered Jan 01 '23 15:01

KCP


Use this CSS workaround. I derived this from the jQuery FileUpload component commit the fixed this issue.

.fileinput-button input {
    -moz-transform : none !important;
    border : none !important;
    border-width : 0 !important;
    transform : translate(-300px, 0) scale(4) !important;
    font-size : 23px !important;
}
* + html .fileinput-button {
    line-height : none !important;
    padding : 2px 15px !important;
}
like image 20
Nick Avatar answered Jan 01 '23 14:01

Nick