3 Replies Latest reply on May 26, 2011 10:10 AM by Sergio Samayoa

    <a4j:commandLink> action and oncomplete are incompatible

    Sergio Samayoa Newbie

      In Ricfaces 3.3 I use to use a combination of action, setPropertyActionListener and oncomplete to select from modalPopup (now called popupPanel with modal=true) to select values from lookup tables, for example:

       

      Open popup:

       

      <a4j:commandLink id="b1" render="pbec"

                                                                                      action="#{entradaCatalogo.buscar('INE_UBICACION')}"

                                                                                      oncomplete="#{rich:component('pbec')}.show()">

                                                                                      <h:graphicImage id="g1" library="img" name="search16.png"

                                                                                                style="border:0" alt="Buscar ubicación"

                                                                                                title="Buscar ubicación" />

                                                                            </a4j:commandLink>

       

      BTW this works ok.

       

      Select value:

       

      <a4j:commandLink id="l1" value="#{r.codigo}"

                                                                  action="#{entradaCatalogo.seleccionar()}"

                                                                  oncomplete="#{rich:component('pbec')}.hide();" render="#{render}">

                                                                  <f:setPropertyActionListener target="#{ppEmpleado.dummy}"

                                                                            value="#{r.codigo}" />

                                                        </a4j:commandLink>

       

      The backing bean selecionar() method is just a dummy method which should force post but this later commandLink doesnt invoke the method just executes the javascript attached to oncomplete event. BTW, I inspected the response from server and the expected render element came in the ajax response but the method seleccionar() in the backign bean was never executed. popupPanel has its own form and I'm sure that isn't wrongly defined inside other form.

       

      Weird since first commandLink executes backing bean method then show the panel but second commandLink doesn't.

       

      Has someone experienced this problem?

       

      Regards.