commandButton does not fire the actionListener

UI Components for JSF
Post Reply
Babas007
Posts: 251
Joined: 24 May 2011, 09:42

25 May 2011, 16:12

Hi everyone,

Simple problem, but hard to fix (my point of view), i'm simply trying to fire a method when I click on a button:

Code: Select all


        <p:confirmDialog message="Are you sure?" width="200"  
                         showEffect="explode" hideEffect="explode"  
                         header="Confirm" severity="alert" widgetVar="confirmation">  

            <p:commandButton value="Yes sure" update="pendings actives" actionListener="#{policyController.deleteXacmlPolicy}" oncomplete="confirmation.hide()"/>  
            <p:commandButton value="Not yet" onclick="confirmation.hide()" type="button" />  

        </p:confirmDialog>
Nothing happens, why?
Thanks for your advices

Babas007
Posts: 251
Joined: 24 May 2011, 09:42

26 May 2011, 17:09

I think, this example http://www.primefaces.org/showcase-labs ... Column.jsf should be re-checked...
I found the issue! I had to put process="@parent" in commandButton, it works in a confirmDialog, but not in a dialog component why?

Babas007
Posts: 251
Joined: 24 May 2011, 09:42

27 May 2011, 09:53

Up! I put the code of the dialog:

Code: Select all

        <p:dialog header="Policy Detail" widgetVar="policyDialog" resizable="false" id="policyDlg"  
                  width="500" showEffect="fade" hideEffect="explode" modal="true">  
            <h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">  

                <f:facet name="header">  
                    <p:graphicImage value="/resources/images/user.png" />  
                </f:facet>  

                <h:outputText value="Subject:" />  
                <h:panelGroup>  
                    <h:outputText value="#{userController.findUsername(policyController.selectedPolicy.subject)}" style="font-weight:bold" />
                </h:panelGroup>  

                <h:outputText value="Description:" />  
                <h:panelGroup>  
                    <h:outputText value="#{policyController.selectedPolicy.description}" style="font-weight:bold"/>  
                </h:panelGroup>  

                <h:outputText value="Action:" />  
                <h:panelGroup>  
                    <h:outputText value="#{policyController.selectedPolicy.action}" style="font-weight:bold"/>  
                </h:panelGroup>  

                <h:outputText value="Decision:" rendered="#{policyController.editMode}" />
                <h:panelGroup rendered="#{policyController.editMode}">  
                    <p:selectOneMenu value="#{policyView.decision}" style="width: 120px">  
                        <f:selectItems value="#{policyView.decisionItems}" />  
                    </p:selectOneMenu>
                </h:panelGroup>  

                <h:outputText value="Obligations:" rendered="#{policyController.editMode}" />
                <h:panelGroup>  
                    <p:selectManyMenu value="#{policyView.obligations}" rendered="#{policyController.editMode}" style="width: 120px">  
                        <f:selectItems value="#{policyView.obligationItems}" />  
                    </p:selectManyMenu>
                </h:panelGroup>

                <f:facet name="footer">  
                    <p:outputPanel rendered="#{policyController.editMode}" layout="block" style="text-align:right">  
                        <p:commandButton value="Save" update="actives pendings" actionListener="#{policyController.updateXacmlPolicy}" image="ui-icon ui-icon-check" oncomplete="policyDialog.hide()" process="@parent" style="width: 90px"/>  
                        <p:commandButton value="Cancel" onclick="policyDialog.hide()" type="button" image="ui-icon ui-icon-close" style="width: 90px"/>  
                    </p:outputPanel>  
                </f:facet>  
            </h:panelGrid> 
        </p:dialog>  
Almost the same than in the example

Babas007
Posts: 251
Joined: 24 May 2011, 09:42

28 May 2011, 17:41

if I put not in a dialog window but in a panel it works...What I suppose to do?

Babas007
Posts: 251
Joined: 24 May 2011, 09:42

29 May 2011, 12:46

Come on...Nobody can help for such thing????

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 May 2011, 13:09

Please do not bump your posts, clearly it seems noone has free time to spare to provide help.

martinPrime
Posts: 41
Joined: 11 Oct 2010, 18:26

29 May 2011, 21:23

Hi,

I think I came across the same problem, see:
http://primefaces.prime.com.tr/forum/vi ... =3&t=11585

Maybe it has something to do with the footer facet? I'm not using the commandLink / commandButton within a dialog but within a table; however, I also put the commandLink into a footer facet as you did.
Also with the latest build of 3.0 M2 SNAPSHOT it doesn't work.

ss4pagm
Posts: 6
Joined: 27 Jul 2011, 21:34

16 Mar 2012, 18:48

After striving with a similar problem (a p:ajax listener not fired), i finally found the problem -and i think it's a primefaces bug)- is the 'process' atribute. When removed from the p:ajax the listener is fired correctly; however, the necessary processing of the component is not carried out.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 65 guests