Fileupload stopped working with new PF Elite Versions

UI Components for JSF
Post Reply
sthe
Posts: 21
Joined: 10 Jun 2014, 08:42

22 Aug 2014, 08:39

Server: Tomcat 7
Myfaces:2.1.7
Primefaces: 3.5 want to Upgrade on 3.5.28
Theme: MetroUI 1.0.1

Fileupload Code:

<p:fileUpload
fileUploadListener="#{ordersNewBean.listenerHandleFileUpload}"
mode="advanced" update="msg_dialog" multiple="false"
sizeLimit="#{ordersNewBean.fileUploadSizeLimit}"
dragDropSupport="true"
allowTypes="#{ordersNewBean.fileUploadAllowedTypes}"
invalidSizeMessage="#{msg.file_error_file_size_dialog}"
label="#{msgs.file_action_choose}"
uploadLabel="#{msgs.file_action_upload}"
cancelLabel="#{msgs.file_action_cancel}" />


With this Code example the following happens.

Upload File with PF 3.5
IE9: works
Firefox: works

Upload File with PF 3.5.8
IE9: upload Button in p:fileUpload does not work.nothing happens
Firefox: works

Upload File with PF 3.5.9
IE9: message hint because of false file ending but file ending is correct
Firefox: works

Upload File with PF 3.5.10;3.5.11;3.5.25;3.5.27,3.5.28
IE9: does not work. Nothing happens when clicking the upload button.Listener function not called
Firefox: does not work. Nothing happens when clicking the upload button.Listener function not called

Firebug Console output when clicking upload selcted file:
TypeError: c.source is undefined
...(f,g,c){var d=$.type(c.source)==="string"?c.source:c.source.name;if($.inArray(d,...

No server side errors


Does anyone have a hint whats the cause of this trouble?



thnaks steffen

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

22 Aug 2014, 08:48

cache not refreshed?

sthe
Posts: 21
Joined: 10 Jun 2014, 08:42

22 Aug 2014, 09:10

Not the solution

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

22 Aug 2014, 11:16

wrong form around it? Things HAVE changed between 3.5.8 and 3.5.9 and up:

http://code.google.com/p/primefaces/iss ... il?id=3420

sthe
Posts: 21
Joined: 10 Jun 2014, 08:42

22 Aug 2014, 12:15

Form around looks like this:
<h:form id="dialogUpload" enctype="multipart/form-data">
<p:dialog header="#{msgs.file_upload_dialog}"

.....
</p:dialog>
</h:form>

I use Myfaces 2.1.7 and commons-fileupload
should change something?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

22 Aug 2014, 12:30

no idea, I don't use fileUpload myself (yet), so I can only mention what I read in other posts. If you use modal and appendToBody it might not work for that reason. Form has to be inside the dialog then. But since you post code snippets I cannot say. Next time please try to post a fully working example that demonstrates the problem but at the same time is as minimalistic as possible.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

22 Aug 2014, 12:35

oh and make sure IE is NOT running in compatibility mode or whatever

sthe
Posts: 21
Joined: 10 Jun 2014, 08:42

22 Aug 2014, 12:53

this code:

<h:form id="dialogUpload" enctype="multipart/form-data">
<p:dialog header="#{msgs.file_upload_dialog}"
widgetVar="objectUpload" resizable="false" showEffect="clip"
hideEffect="fold" id="dialogUpload" modal="false" dynamic="true">
<p:messages id="msg_dialog" />
<h:panelGrid id="displayUpload" columns="2" cellpadding="4">
<p:fileUpload
fileUploadListener="#{ordersNewBean.listenerHandleFileUpload}"
mode="advanced" update="msg_dialog" multiple="true"
sizeLimit="#{ordersNewBean.fileUploadSizeLimit}"
dragDropSupport="true"
allowTypes="#{ordersNewBean.fileUploadAllowedTypes}"
invalidSizeMessage="#{msg.file_error_file_size_dialog}"
label="#{msgs.file_action_choose}"
uploadLabel="#{msgs.file_action_upload}"
cancelLabel="#{msgs.file_action_cancel}" />
</h:panelGrid>

</p:dialog>
</h:form>

is working fine with PF 3.5. But not with PM Elite Versions higher than 3.5.7.

sthe
Posts: 21
Joined: 10 Jun 2014, 08:42

23 Dec 2014, 13:15

Fileupload and BlockUI does not work together. That was the cause!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 57 guests