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

No communication between newly navigated .xhtml and its bean after navigating from one view to another
JSF ClassCastException while preparing data in bean [duplicate]
What's the real value for com.sun.faces.defaultResourceMaxAge in Mojarra
java JSF list of objects where each object is selectable with selectOneMenu
cannot assign a value to a variable in Backing Bean in JSF [duplicate]
is it possible to include the value of the 'id' attribute in the 'rendered' condition of a JSF component?
value not retained in text box in parent window when passed from child window
p:treeTable with ui:repeat in header
Primefaces redirect to login null pointer exception
Control generated ID of ui:repeat
How to Compare the values JSF selectonemenu
Open each link a new p:tab in p:tabView
ajax status custom jsf 2 update from bean [duplicate]
Placeholder in resource bundles
JSF h:inputHidden managed bean value not updated in ajax call
How to convert int to string in Expression Language?

Categories

HOME
cakephp-3.x
ssas-2012
pug
erlang
redis
vhdl
itext
rotation
nuxeo
google-tag-manager
visualization
vlc
rocketmq
azureservicebus
webdav
nodemailer
google-plus
powershell-v3.0
window
xamarin-studio
nixos
wysiwyg
postmessage
reduction
scenebuilder
rhapsody
quartus
flexlm
flexboxgrid
scalaz7
tcpclient
iup
scalajs-react
printdocument
data-cleansing
onesignal
osmdroid
guile
bus-error
cep
classpath
pentaho-report-designer
reply
twitter-bootstrap-2
consumer
modulo
service-locator
precedence
jquery-cycle2
coreclr
elfinder
ical-dotnet
dojox.mobile
pytest-django
scalafx
chown
greenhills
gce
pycurl
communication-protocol
coremidi
master
tomee
packagemaker
icefaces
mailcatcher
ruby-2.0
multiple-file-upload
metalsmith
shipitjs
spring-lemon
fill
git-rebase
approval-tests
asymptote
loose-typing
optionbutton
retro-computing
windowlistener
visual-studio-code
ffprobe
ejabberd-saas
client-side-validation
utf-32
tcpreplay
em
ghostdoc
libssh2
system.web
bullet
planetary.js
pic24
late-static-binding
winrt-httpclient
sanitization
argb
mstsc
qt4.6
sametime
mpmovieplayer
redirectstandardoutput
parameterization
visual-web-gui
maven-ant-tasks
cross-domain-policy
querystringparameter
nemerle
datacontract
ihttphandler
nvelocity
post-redirect-get
odbc-sql-server-driver
usergroups

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