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

ADF: Show/hide options in af:navigationPane
JSF ActionListener doesn't fire
Capturing primefaces <p:autoComplete> change event (detect emptying)
Primefaces intelligently finds dialog?
prime faces default value in selectOneMenu
What is an alternative of a4j:JsFunction in JSF 2.0?
Removing Alert while refreshing page
In JSF p:dialog not updating dataList
DataList data in one Row
Debugging JSF Life Cycle - what exactly happens in each phase
When it is essential to use a h:form, a a4j:region and a a4j:form in JSF?
jsf 2.2, netbeans, ui:remove - Tag Library supports … but no tag was defined for name: remove
WELD-001456 Argument bean must not be null
empty targetValue in rich listShuttle
JSF - ternary operator in value attribute
Confusion JSF Updating Value of Input text in Backing bean

Categories

HOME
xbox-live
sas
udp
crate
project-management
qpython3
docker-swarm
survival-analysis
flyway
value
data-science-experience
structuremap
deeplearning4j
eclipse-cdt
oclint
outlook-web-addins
lagom
spinnaker
pdo
opera-mini
aspell
uicollectionview
factor-analysis
raphael
bootstrap-typeahead
yosys
printdocument
katharsis
java-ee-7
osmdroid
ab-initio
fileinfo
pcre
devforce
piecewise
apache-cloudstack
ifstream
swiftcharts
nlb
ksoap
autocompletetextview
elfinder
jquery-multidatespicker
cgo
knockout-3.0
distributed-transactions
intersystems-ensemble
crop
rkt
amd
timesten
sgmlreader
photon-controller
quintus
httplib2
python-hypothesis
emgu
multiple-file-upload
pagekit
windows-nt
ng2-material
mongoskin
spring-repositories
fps
scriptlet
picking
asp.net-mvc-partialview
concur
xmp
bluesnap
vips
retro-computing
urn
sysfs
word-2013
line-numbers
jquery-autocomplete
gyroscope-framework
formvalidation-plugin
docopt
httpcontext
config-files
sslexception
robospice
vmware-server
multiple-conditions
objcmongodb
lync-server-2010
dropdownlistfor
cbcentralmanager
cadisplaylink
gjs
fileutils
posting
smooth
svn-hooks
msn
recordset
clients
webrat
asp.net-mvc-controller
web-statistics
inline-if
economics





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