jsf


p:commandButton doesn't call action


I have two dialogs, each of which has a button. If I place own form inside each dialog, then both buttons do not call their listener-methods, if I remove the forms inside the dialogs, only the button from the first dialog calls the listener-method.
<h:form id="mainForm">
<p:commandLink oncomplete="PF('editPersonalDataDialog').show()" title="Edit data" styleClass="fa fa-edit param-item"/>
<p:commandLink oncomplete="PF('editPasswordDialog').show()" title="Edit password" styleClass="fa fa-edit param-item"/>
</h:form>
<p:dialog header="Edit personal data" widgetVar="editPersonalDataDialog" resizable="false" position="center">
<h:form>
<p:commandButton id="saveData" value="Save" actionListener="#{profileBean.editPersonalData}" icon="fa fa-save" styleClass="btn"/>
</h:form>
</p:dialog>
<p:dialog header="Edit password" widgetVar="editPasswordDialog" resizable="false" position="center">
<h:form>
<p:commandButton id="savePassword" value="Save" actionListener="#{profileBean.changePassword}" icon="fa fa-save" styleClass="btn"/>
</h:form>
</p:dialog>
Try putting the dialog forms outside the dialog Like:
<h:form id="form1">
<p:dialog ...>
<h:outputPanel id="panel1">
.... your code...
</h:outputPanel>
</p:dialog>
</h:form>
then call it like this; use onclick and update in your commandLink...
<h:form id="mainForm">
<p:commandLink onclick="PF('editPersonalDataDialog').show()" title="Edit data" styleClass="fa fa-edit param-item" update="form1:panel1"/>
<p:commandLink onclick="PF('editPasswordDialog').show()" title="Edit password" styleClass="fa fa-edit param-item" update="form2:panel2"/>
</h:form>

Related Links

JSF + PrimeFaces returns blank page
selectOneMenu enum validation error [duplicate]
How to insert conditional rows in a panelGrid while keeping the rows succinct?
No webpage found - 404 - after migrating from Richfaces 3.3 to Richfaces 4.5.17 and jsf 1.x to jsf 2.2.14
I am using the primefaces example of the chat, apparently I have an exception when trying to open the channel
getExternalContext().getRequestParameter().get is null [duplicate]
Session bean timeout issues [duplicate]
p:message not rendered
PrimeFaces Schedule: Custom Header button
JSF Table remains empty [duplicate]
JSF: selectOneListBox with checkboxes
Primefaces Validation error with converter and equals working
Primefaces 6: update input when menuitem clicked
Primefaces UIComponents getValue() always return null in Dialog window
Primefaces: dialog doesn't show up when dataTable is used
Richfaces rendering not working with <a4j:support> for drop downs

Categories

HOME
wmic
windows-7
boost-thread
translation
ubuntu-12.04
xtext
nodemailer
netflix-feign
height
google-classroom
finite-group-theory
data-synchronization
rapidjson
eclipse-luna
sendkeys
ejs
eclipselink
cython
jni
apple-tv
url.action
ghost-inspector
binutils
novnc
fabric
visual-c++-2017
jenkins-job-dsl
osmdroid
interrupt-handling
web-frontend
classpath
solidworks
pcre
twitter-bootstrap-2
apache-cloudstack
pyscripter
m2e
freebase
ocs
mms
es-shell
codesys
meta-raspberrypi
linq-to-entities
xbim
datalog
ttcn
prototypejs
nstouchbar
livescribe
rollback
struts-layout
text-classification
opencpu
teiid
redux-router
polar-coordinates
festival
efxclipse
cfeclipse
rmongodb
boost-hana
mongoskin
image-editing
inet
yoothemes
cmocka
getrusage
android-viewholder
selendroid
paypal-nvp
integral
stream-framework
stackframe
es2015
searchkick
low-level
word-2013
multipleselection
ctrlp
chaining
node-inspector
funq
sid
system.web
level
jstack
android-json-rpc
jquery-tabs
driver-signing
shortcuts
graph-coloring
snapjs
tridion2009
git-filter-branch
linkedhashset
qsqltablemodel
moq-3
blockingqueue
caliper
objective-c-protocol
law-of-demeter
querystringparameter
winsnmp
virtualquery
self-reference
dotproject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App