2 Replies Latest reply on Dec 12, 2008 10:08 AM by haodi9

    reRender does not work with a4j:commandLink at the second ti

    haodi9

      I am trying to implement the page navigation with ajax.
      I use <a4j:include viewId="#{pageNavigation.destPage}" /> to implement it.
      Here is the main page.

      <body>
      
       <f:view>
      
       <h:panelGrid width="100%" cellpadding="0" border="0" columns="1">
       <a4j:include viewId="test3.jsp" />
      
       <a4j:outputPanel id="contentArea" ajaxRendered="true">
       <a4j:include viewId="#{pageNavigation.destPage}" />
       </a4j:outputPanel>
      
      
       <a4j:include viewId="test2.jsp" />
      
       </h:panelGrid>
       </f:view>
       </body>


      In the test2.jsp and test3.jsp there is each a commandlink.



      <h:form>
      
       <a4j:commandLink value="regist" reRender="contentArea" >
       <a4j:actionparam name="to" value="test5.jsp" assignTo="#{pageNavigation.destPage}"></a4j:actionparam>
       </a4j:commandLink>
      
       </h:form>


      <h:form>
      
      <a4j:commandLink value="Password" reRender="contentArea" >
       <a4j:actionparam name="to" value="test4.jsp" assignTo="#{pageNavigation.destPage}"></a4j:actionparam>
       </a4j:commandLink>
       </h:form>


      Now it is very strange. If I click the "Password" firstly, the panel will be rendered correctly. But then I click the "regist", it does not work. The page remains unchanged.

      Anyone can tell me why? And what is the general solution to implement the page navigation with jsf and ajax4jsf? Thanks a lot!

        • 1. Re: reRender does not work with a4j:commandLink at the secon
          ilya_shaikovsky

          add phase-tracker to your libraries and show the generated log for the request which can't do needed page switch.

          • 2. Re: reRender does not work with a4j:commandLink at the secon
            haodi9

            Here is the result with PhaseTracker:

            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RESTORE_VIEW 1
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RESTORE_VIEW 1
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE APPLY_REQUEST_VALUES 2
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER APPLY_REQUEST_VALUES 2
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE PROCESS_VALIDATIONS 3
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER PROCESS_VALIDATIONS 3
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE UPDATE_MODEL_VALUES 4
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER UPDATE_MODEL_VALUES 4
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE INVOKE_APPLICATION 5
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER INVOKE_APPLICATION 5
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker beforePhase
            INFO: BEFORE RENDER_RESPONSE 6
            12.12.2008 16:01:52 org.exadel.jsf.PhaseTracker afterPhase
            INFO: AFTER RENDER_RESPONSE 6

            And I found if I refresh the page manually , then it works.
            Why?