Hello,
I am completely new to Primefaces (even JSF for that matter) and was trying to build one simple webform to send an email.
I have almost finished it but I'm trying to use p:commandButton and p:fileUpload in the same form but the form doesn't gets submitted.
Instead I use h:commandButton and it works perfectly fine. But with this, I don't know if I can validate client so easily.
Please help. Thanks in advance.
File Upload and Submit
The difference between an p and h commandButton is that the former is by default ajax enabled. Try with an ajax enabled h:commandButton. Does that fail to? And please read the static topic, the one with PLEASE, PLEASE in it. Version info and mcve
-
- Posts: 5
- Joined: 08 Jun 2017, 20:29
Thanks,
Primefaces button works when set to ajax="false". I'll try to validate client now.
I used ajax with h:commandButton and it works as well. Just used below snippet of code and I got email twice
<h:commandButton value="Send Email" action="#{indexView.submitForm}">
<f:ajax execute="@form" listener="#{indexView.submitForm()}" />
</h:commandButton>
Primefaces button works when set to ajax="false". I'll try to validate client now.
I used ajax with h:commandButton and it works as well. Just used below snippet of code and I got email twice
<h:commandButton value="Send Email" action="#{indexView.submitForm}">
<f:ajax execute="@form" listener="#{indexView.submitForm()}" />
</h:commandButton>
-
- Posts: 5
- Joined: 08 Jun 2017, 20:29
Thanks again!
So, do we know how to get ajax working with file upload. I'm now trying to use p:commandLink as well and as submit, it doesn't work with ajax = true
-
- Information
-
Who is online
Users browsing this forum: No registered users and 46 guests