2 Replies Latest reply on Jun 6, 2007 8:38 PM by vh

    <a4j:keepAlive> question

    vh

      I used the following to make a wizard work.

      <a4j:keepAlive beanName="addDesktopBean" />

      The problem is, every time user click on "Cancel", I need to go to my server side bean to clear up all the fields that user has entered already.
      Is there a way to just stop this bean from being "alive", so the next time, it will be created again, so all the field inside the bean is automatically clearned?

        • 1. Re: <a4j:keepAlive> question

          keepAlive has ajaxOnly attribute. If it set to true, the previous state of the bean will not restored during the regular (non-ajax) request.

          • 2. Re: <a4j:keepAlive> question
            vh

            If the following AJAX call? I have <a4j:keepAlive beanName="vcBean" ajaxOnly="true"/>

            But when I kit the OK button, I can see a new vcBean is created.

             <form>
             <table>
             <tr><td><h:outputText value="#{bundle.confirmVC}"/></td></tr>
             <tr>
             <td align="center">
             <a4j:commandButton actionListener="#{vcBean.saveVC}"
             value="#{bundle.OK}"
             oncomplete="Richfaces.hideModalPanel('confirmVcMp');closeWindow('editVcForm:errPanel','editVcMp');"
             reRender="vcTable,editVcMp,error" >
             </a4j:commandButton>
             <rich:spacer height="4px" width="10px"></rich:spacer>
             <a4j:commandButton
             actionListener="#{vcBean.clearTestFlag}"
             oncomplete="Richfaces.hideModalPanel('confirmVcMp');Richfaces.showModalPanel('editVcMp');"
             reRender="vcTable,editVcMp,error"
             value="#{bundle.Cancel}">
             </a4j:commandButton>
             </td>
             </tr>
             </table>
             </form>