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

Alternative for <ice:outputHtml> in jsf 2.1 [duplicate]
Dynamic Checkboxes in array jsf [duplicate]
Popup not getting displayed properly
PrimeFaces tag code completion does not work in Netbeans
XPages - Bean does not exists error after code paste
Can't get the parameter of the action in my bean using primefaces diagram
How close dialog from code JSF [duplicate]
How to make commandButton do only actionListner method without submiting values [duplicate]
JSF selectBooleanCheckbox always checked
JSF/ADF selectOneListBox up/down event?
jsf 1.2 update form without submit value
how to update a compenent in jsf
Display p:fileupload image in p:graphicImage preview without saving it
Date range for p:slider
How to correct the calling interval for a function with p:poll?
#FacesConverter forClass-Attribute does not work

Categories

HOME
paypal
mql4
vb6
backup
d
ubuntu-12.04
h2
vsftpd
ndis
finite-group-theory
nuxt.js
uiview
postmessage
uisplitviewcontroller
cairo
zoomcharts
device-detection
jconsole
fop
cocoa-touch
spring-ws
jflex
badge
dpi
superagent
blackboard
devforce
precedence
autocompletetextview
dql
code-behind
taglib
rdw
lumen-5.3
range-v3
gauss
gist
pinvoke
mouseclick-event
jgraph
persistent
launch
addin-express
visual-studio-templates
redux-router
shinyjs
pydio
excon
json-schema-validator
gameanalytics
webkit2
mercurial-hook
django-south
vine
team-build
playscape
on-duplicate-key
ubercart
criteria-api
git-checkout
sysfs
ctrlp
orientation-changes
activity-streams
pgagent
microblaze
libssh2
ember-addon
planetary.js
reserved-words
edit-in-place
healthvault
baucis
pyjade
logentries
fogbugz-api
facebook-sdk-3.1
va-list
reporting-tools
vt100
attachevent
vim-powerline
shim
ets
rijndael
pureftpd
email-spec
sitemappath
camtasia
iphone-sdk-3.2
webrat
handheld
interface-design

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