문제

I'm having a problem with firing an action with a p:commandButton when there's a p:fileUpload on my page: Here's the p:fileUpload

<p:fileUpload  auto="true" update="seqForm:sequence1"
allowTypes="/(\.|\/)(txt)$/"
fileUploadListener="#{fileUploadController.fileUploadListener1}" />

and the p:commandButton:

<p:commandButton id="submitButton" value="Submit!" 
action="#{submitAction.actionTest}"
update="seqForm:content"  />

When I add the fileUpload component to the page, its listener gets normally fired. However, the action of the commandButton doesn't work. If i remove the fileUpload from the page, the action from the button works fine.

Is it a bug or something I still haven't discovered? Thanks in advance.

도움이 되었습니까?

해결책 2

I have fixed this issue using the following:

Link for the solution

I found this replacing the p:commandButton with h:commandButton. When I did it, the following error showed up:

The request content-type is not a multipart/form-data

Next I googled this and found the link above. Thanks anyway.

다른 팁

Which PrimeFaces version and JSF implementation (with version) are you using? In the past there was an issue with form's enctype. Try newest version, or if it is not applicable for you, try to put the fileupload into different form

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top