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

Update primefaces datatable from actionListener [duplicate]
How to display two p:datable horizontally in an h:form [duplicate]
PrimeFaces datatable celledit NullPointerException [duplicate]
Primefaces panels appear open when collapsed is set to true
Primefaces SelectOneMenu, selection on filter
Is it possible to set variable name in bean injection?
JSF: Datatable is not updating
display captured image from photocam
Unable to find or serve localized resource from jsf-resource-library
Add a new p:SelectOneMenu to a JSF page dynamically from the Backing bean
JSF #ViewScoped - #Postconstruct called multiple times [duplicate]
How to add a String to ValueExpresion programatically
How to Export only selected columns using columnToggler
Navigating outside of dir into a different directory in primafaces
HttpSession Attribute vs SessionScoped CDI Bean [duplicate]
jsf download file from amazon cloudfront

Categories

HOME
sql-server-2008
caching
cntk
redis
dynamics-crm
system-verilog
raspbian
fparsec
ruby-on-rails-3
mainframe
chaiscript
vlc
ll
value
ext.net
schemacrawler
contact-form-7
xlsx
cross-platform
redux-observable
chocolatey
propel2
tortoisegit
embedly
thingsboard
ghost-inspector
nsmenuitem
iup
rworldmap
go-cd
jquery-scrollify
samsung-mobile
kong
interrupt-handling
chrome-native-messaging
dpi
gzip
outsystems
oracle-xml-db
fabric-digits
hashcat
rider
inkscape
soundjs
common.logging
cgo
dart-pub
rkt
bids
ideone
walmart-electrode
number-theory
ti-basic
sapui
sgmlreader
multi-agent
xmgrace
tofixed
vici
createobject
nsfetchedresultscontrolle
xib
wcf-ria-services
pax-web
uiprogressview
instruments
ng2-material
spring-lemon
aerogear
license-key
file-diffs
lmfit
response-headers
integral
pyopengl
ubercart
uos
odftoolkit
google-admin-audit-api
korma
winrt-httpclient
opendata
ruboto
qtgui
wcf-web-api
macruby
die
emacs23
rijndael
post-redirect-get
hadoop-plugins
yajl
communicationexception
visual-studio-2010-beta-2
internals
standardized





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss