p:commandButton disable problem

UI Components for JSF
Post Reply
User avatar
zorro6064
Posts: 59
Joined: 01 Mar 2011, 16:20

24 Dec 2011, 13:05

in my code:

Code: Select all

<p:dialog header="confirm dialog" widgetVar="satnaDialog" resizable="false" width="700"
                          showEffect="explode" hideEffect="explode" modal="true">
      <div align="right" style="font-weight: bold">
                        <h:selectBooleanCheckbox value="#{iSatna.confirmButton}" >
                            <p:ajax update="cnfButton" listener="#{iSatna.confirmButtonListener}" />
                        </h:selectBooleanCheckbox>
                        <h:outputText value="Are you sure?" />
                    </div>
                    <div align="center">
                        <p:commandButton id="cnfButton"  value="Ok" disabled="#{not iSatna.confirmButton}"
                                         ajax="false" action="#{iSatna.satna_transfer}" oncomplete="satnaDialog.hide()"
                                         update="grwtrs"/> &nbsp;&nbsp;
                        <p:commandButton value="Cancel" onclick="satnaDialog.hide()" />
                    </div>
</p:dialog>
with clicking the checkbox (iSatna.confirmButton sets to true), the "Ok" button with "cnfButton" id, enabled.
but by clicking this button, action not call.
what is problem?
Can any body help me?

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

25 Dec 2011, 05:30

action="#{iSatna.satna_transfer}" in the code below.

Code: Select all

<p:commandButton id="cnfButton"  value="Ok" disabled="#{not iSatna.confirmButton}"
                                         ajax="false" action="#{iSatna.satna_transfer}" oncomplete="satnaDialog.hide()"
                                         update="grwtrs"/>
Please respond with the bean source of "#{iSatna.satna_transfer}".
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

blueskypoa
Posts: 2
Joined: 10 Apr 2012, 23:26

11 Apr 2012, 00:40

I know the topic is almost dead, but I am in this trouble too. Some kind soul? :D

blueskypoa
Posts: 2
Joined: 10 Apr 2012, 23:26

11 Apr 2012, 01:30

Found the solution at

http://stackoverflow.com/questions/9000 ... iring-ajax

Thanks to BalusC
blueskypoa wrote:I know the topic is almost dead, but I am in this trouble too. Some kind soul? :D

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

11 Apr 2012, 02:40

smithh032772 wrote:Please respond with the bean source of "#{iSatna.satna_transfer}".
That is why I asked this/above. I wanted to advise to NOT use 'requestscoped', if you were doing that. BalusC is awesome and I always refer people to his answers/posts/blogs.

When you ask questions, provide your bean AND xhtml. scope is very important, especially if you are using requestscope incorrectly or in a scenario where requestscoped will not allow you to meet business requirement.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 36 guests