2 Replies Latest reply on Jan 10, 2011 4:32 PM by Nicolas Carron

    Why my action located within a rich:modalPanel is not executed

    Nicolas Carron Newbie

      I tried to implement a modal panel to let the user confirm the deletion of some entities without successful.

       

      H|ere is the code :

       

      1) the command I use to do some staff before entities deletion and to show the modal on completion :

       

      <h:form>

          <a4j:commandButton value="a4j:commandButton"  action="#{contractDeletor.prepareJob}"

              reRender="deleteContractsConfirmModalPanelId" ajaxSingle="true"

                      oncomplete="Richfaces.showModalPanel('deleteContractsConfirmModalPanelId',{width:400, top:200})" />               

      </h:form>

      <a4j:include viewId="/ContractDeletionModal.xhtml" rendered="true" />

       

      1) the code of the modal (simplified for understanding) :

       

      <rich:modalPanel id="deleteContractsConfirmModalPanelId"

          autosized="true">

          <div id="deleteContractsConfirmModalPanelDivId">

          <form id="deleteContractsConfirmModalPanelForm">

              <a4j:commandButton value="a4j:commandButton"

                  action="#{contractDeletor.doJob}"

                  oncomplete="Richfaces.hideModalPanel('deleteContractsConfirmModalPanelId');"

                  reRender="deleteContractsConfirmModalPanelDivId" /></form>

          </div>

      </rich:modalPanel>

       

      When I click on the command a post back is performed whitout executing the action ??

       

      3) the related action (simplified):

       

      @Name("contractDeletor")

      public class ContractDeletor extends BaseListAnimator implements

              Serializable {

       

          private static final long serialVersionUID = -1465053605583307302L;

       

          public String prepareJob() {

              log.info("Prepare the job");

       

              return null;

          }

       

          public String doJob() {

              log.info("Do the job");

       

              return null;

          }

      }

       

      I also tried to put the modal within the same page of the command that show it but it has the same effect. I probably miss something but I can figure it out.

       

      Many thanks in advance