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

Primefaces schedule, event header color changed which is saved in DB
Button do not work jsf [duplicate]
JSF2.2 Component to wrap a repeat
Send parameter to request on every action for composite component
Validation not working properly when editing p:autoComplete
Primefaces p:pickList and the required attribute
If else condition in jsf [duplicate]
How to decode commandButton action
How to Inject FacesContext in Arquillian
SelectItem with null value
Extensionless URLs with OmniFaces FacesView does not work in 1.12
missing content in internet explorer 11
PF5.3 Atmosphere2.4 Glass fish exception:Request is within the scope of a filter or servlet that does not support asynchronous operations
primefaces commandButton action not called when rendering attribute is present
Passing an object through JavaScript with RemoteCommand
How to bind an input value from dynamically generated form to a object of a list in bean

Categories

HOME
visual-studio-2015
crate
laravel-5.3
travis-ci
apache2
ios10
simpy
currency
diagram
wordpress-theming
uiscrollview
public-key-encryption
cs-cart
dendrogram
derived
internet-explorer-8
jogl
mousewheel
multicore
distance
epicor
url.action
nsmenuitem
spring-test
http-method
philips-hue
iis-10
auditing
unpack
system.data.sqlite
forum
construct-2
data-extraction
fabric-digits
salesforce-chatter
css-counter
sidr
ntfs-mft
jquery-multidatespicker
matlab-cvst
encapsulation
prototypejs
openweathermap
drawingarea
greenhills
android-bitmap
volume
etherpad
android-navigationview
spring-ioc
packagemaker
mailcatcher
qregexp
pagekit
gradle-release-plugin
xmp
difference
function-fitting
selendroid
sem
google-plus-one
low-level
pl-i
kallithea
utf-32
left-recursion
candidate-key
jquery-autocomplete
fragment-tab-host
yahoo-boss-api
bullet
voldemort
help-viewer
openkinect
hamsterdb
bsod
trimming
swrl
lame
fraud-prevention
pep8
fortran77
crocodoc
gjs
printing-web-page
qtembedded
posting
sendfile
ruby-debug
pivotal-crm
post-redirect-get
msn
task-management
visual-c++-2008-express
revision
configurable

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