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

javax.el.PropertyNotFoundException: /index.xhtml #11,78 action=“#{data.addMember()}”: Target Unreachable, identifier 'data' resolved to null [duplicate]
How many ELResolver[s] is/are associated with an ELContext in a JSF application?
Dynamically add panelGroup without refreshing entire parent
Ajax event doesn't work when using grid layout in panelGrid
After migration to CDI, managed bean constructor called multiple times
Load primefaces tow dynamic selectOneMenu with #OneToMany relation
Programmatically apply filter to PrimeFaces 5 DataTable
How to render a HTML button element in JSF 2.2?
How to use predefined text in JSF in HTML tag attribute? [duplicate]
JSF 2.2 - Backingbean method not called when using <include> [duplicate]
Format month name of <rich:calendar> as MMM instead of MMMM
p:dataGrid content disappears after ajax update
Managing Required=true in JSF [duplicate]
How to enable/disable inputText on rowSelectCheckbox and rowUnselectCheckbox
JSF is creating two instances of an ApplicationScoped bean
Accessing tag attribute within the same tag without using binding

Categories

HOME
vb6
cpu-architecture
wxwidgets
tomcat7
csvhelper
appmaker
recyclerview
rebol
apiconnect
docker-windows
data-science-experience
pygame
sudo
flexbox
hosts
uiscrollview
apache-karaf
derived
tree-traversal
propel2
backpropagation
sql-update
prediction
header-files
compare-and-swap
jenkins-job-dsl
branch
aurelia-binding
datadog
dd-wrt
cell-array
devforce
smart-mobile-studio
expand
ipfw
rhomobile
large-data
xen
forecasting
nashorn
spring-bean
pytest-django
bids
nsjsonserialization
tuleap
defold
nstouchbar
applepayjs
openh264
quintus
launch
atlassian-crowd
cjson
tomee
mongoose-populate
spoofing
mongo-c-driver
dac
proxygen
except
galaxy
insert-into
application-loader
app.xaml
kendo-menu
sem
mptcp
harp
jquery-autocomplete
hidden-field
snmp4j
libssh2
sthttprequest
ember-addon
dache
emma
coin-flipping
funkload
sgml
lumx
broadcasting
svcutil.exe
flash-cc
roxygen
sanitization
fogbugz-api
nimrod
appfog
trailing-slash
deploying
emacs23
charts4j
posting
dcpu-16
gethashcode
nvelocity
external-assemblies
swfloader
data-execution-prevention
hardware-infrastructure
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