Issue with <p:ajax>

UI Components for JSF
Post Reply
User avatar
pitutos
Posts: 52
Joined: 23 Jul 2010, 01:28

04 Aug 2010, 21:12

Hi, I have this code:

Code: Select all

<p:dialog header="Eliminar Usuario" widgetVar="delUsrDialog" modal="true" width="300"
                      showEffect="drop" hideEffect="explode" position="center">
                <div align="center">
                    <h:outputText value="¿Está seguro que desea eliminar al usuario?" />
                    <br /><br />
                    <p:commandButton value="Aceptar" action="#{usuariosBean.delete}" update="growl" oncomplete="delUsrDialog.hide()">
                         <p:ajax event="click" update="usrDataTable" />
                    <p:commandButton type="button" value="Cancelar" onclick="delUsrDialog.hide()" />
                    <br />
                    <p:ajaxStatus>
                        <f:facet name="start">
                            <h:graphicImage value="../icons/busy.gif" />
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value="" />
                        </f:facet>
                    </p:ajaxStatus>
                </div>
            </p:dialog>
When this code is executed, <p:ajax> fires up, but does not update usrDataTable (<p:dataTable>), I have to put the property 'onCloseUpdate="usrDataTable"' on the <p:dialog> to update the <p:dataTable/>. Am I doing something wrong or is a <p:ajax> problem?
NetBeans 7.1
Mojarra-2.1.7
PrimeFaces-3.0.1
Tomcat 7.0.22

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

05 Aug 2010, 12:52

You have an invalid markup, try;

Code: Select all

<p:commandButton value="Aceptar" action="#{usuariosBean.delete}" update="growl usrDataTable" oncomplete="delUsrDialog.hide()" />

User avatar
pitutos
Posts: 52
Joined: 23 Jul 2010, 01:28

05 Aug 2010, 19:19

Yes, I was editing the code and when did the post I copied wrong. I just was trying to do something like this:

Code: Select all

<p:commandButton value="Aceptar" action="#{usuariosBean.delete}" update="growl" oncomplete="delUsrDialog.hide()" >
    <p:ajax event="click" update="usrDataTable" />
</p:commandButton>
But when I was searching in the forum I realized that I could put many ID's in the update property. Thanks, I resolved this, but I was trying to implement <p:ajax> in another components and I realized that the examples in the showcase do not work.

http://www.primefaces.org:8080/prime-sh ... ations.jsf
http://www.primefaces.org:8080/prime-sh ... Events.jsf

Do I need another library? I'm currently using PF 2.1, JSF 2.0, Glassfish v3, Facelets and NetBeans 6.9
NetBeans 7.1
Mojarra-2.1.7
PrimeFaces-3.0.1
Tomcat 7.0.22

User avatar
pitutos
Posts: 52
Joined: 23 Jul 2010, 01:28

07 Aug 2010, 01:10

Problem solved, I forgot to edit the web.xml :roll:
NetBeans 7.1
Mojarra-2.1.7
PrimeFaces-3.0.1
Tomcat 7.0.22

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

08 Aug 2010, 12:01

Good to hear! :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: DarrylPooni and 16 guests