1 Reply Latest reply on Jul 3, 2008 6:02 AM by Rolando Trujillo

    Problem with A4J re-render

    Sirish Vadala Newbie

      Hello...

      I am using ajax4jsf-1.1.0.jar with Sun's JSF RI 1.1. I am using a4j:commandLink to update my backing bean. Variables are getting updated in the backing bean, but my screen component is not getting updated or rerendered.

      The following is my code:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      //ALL INCLUDE TAG LIBS
      <f:loadBundle basename="resources.application" var="bundle"/>
      <f:subview id="billsearch">
      <html>
      <body>
      <script language="JavaScript" src="../scripts/lrrscript.js"></script>
      <h:form id="billSearchForm" >
       <h:messages id="errorMess"/>
       <t:panelTabbedPane
       id="tabPanel" serverSideTabSwitch="false">
      
      <%-- SIMPLE SEARCH TAB --%>
       <t:panelTab id="simpleSearch" label="Search" onkeypress="unsetFlag();" onclick="unsetFlag();">
       <h:inputHidden id="locationtype" value=""/>
       <%-- Some Content --%>
      
      
       </t:panelTab>
      
      <%-- ADVANCE SEARCH TAB --%>
       <t:panelTab id="NewTabadvanceSearch" label="Advance Search">
       <t:panelTabbedPane
       id="subTabPanel" serverSideTabSwitch="false">
      
       <%-- HOME TAB --%>
       <t:panelTab id="subTabOne" label="#{bundle['lis.adv.search.tab.home']}">
       <h:panelGroup>
       <jsp:include page="AdvanceSearch/tabHome.jsp" />
       </h:panelGroup>
       </t:panelTab>
      
       <%-- DISPLAY SAVED CRITERIA TAB --%>
       <t:panelTab id="subTabEleven" label="Saved Search Criteria">
       <h:dataTable id="votetable" value="#{advanceSearchProcess.selectedCriteria}"
       var="searchResultsBean" binding="#{advanceSearchProcess.summarySearchUI}">
       <%-- nitrox:varType="beans.SearchResultsBean" --%>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{bundle.date}" style="width: 70px"/>
       </f:facet>
      
       <a4j:region id="stat2">
       <a4j:status for="stat2">
       <f:facet name="start">
       <h:graphicImage value="/images/ajax_process.gif" />
       </f:facet>
       <f:facet name="stop"/>
       </a4j:status>
       <a4j:commandLink reRender="votetable" styleClass="portletNav" actionListener="#{advanceSearchProcess.loadDetailVotes}" >
       <h:outputText value="#{searchResultsBean.detailsDisplayed ? '-' : '+'}" style="text-decoration: none"/>
       </a4j:commandLink>
       <h:outputText value="#{searchResultsBean.searchCriteriaId}"/>
       </a4j:region>
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{bundle.motion}"/>
       </f:facet>
       <h:panelGroup>
       <h:outputText value="#{searchResultsBean.userId}"/>
       </h:panelGroup>
       <h:panelGroup rendered="#{searchResultsBean.detailsDisplayed}">
       <h:outputText value="#{searchResultsBean.xmlSearchCriteria}"/>
       </h:panelGroup>
       </h:column>
       </h:dataTable>
      
       </t:panelTab>
       </t:panelTabbedPane>
       </t:panelTab>
      
       </t:panelTabbedPane>
      </h:form>
      </body>
      </html>
      </f:subview>


      The intention is that when I click on the link, the details displayed attribute will be set to true in my backing bean. So rerendering the screen would display my details.
      My Action Listener method is:

      public void loadDetailVotes(ActionEvent e) {
       SearchResultsBean searchResultsBean = (SearchResultsBean) summarySearchUI.getRowData();
      
       if (searchResultsBean.isDetailsDisplayed()) {
       searchResultsBean.setDetailsDisplayed(false);
       } else {
       searchResultsBean.setDetailsDisplayed(true);
       }
      
       Utility.Log(Level.INFO, this, "EXIT loadDetailVotes");
       }


      The backing bean is getting updated as I could see that from my log:

      <Jun 11, 2008 1:59:46 PM PDT><Processing new Request!>
      <Jun 11, 2008 1:59:46 PM PDT><before - RESTORE_VIEW 1>
      <Jun 11, 2008 1:59:46 PM PDT><after - RESTORE_VIEW 1>
      <Jun 11, 2008 1:59:46 PM PDT><before - APPLY_REQUEST_VALUES 2>
      <Jun 11, 2008 1:59:46 PM PDT><before - PROCESS_VALIDATIONS 3>
      <Jun 11, 2008 1:59:46 PM PDT><after - APPLY_REQUEST_VALUES 2>
      <Jun 11, 2008 1:59:46 PM PDT><after - PROCESS_VALIDATIONS 3>
      <Jun 11, 2008 1:59:46 PM PDT><before - UPDATE_MODEL_VALUES 4>
      <Jun 11, 2008 1:59:46 PM PDT><after - UPDATE_MODEL_VALUES 4>
      <Jun 11, 2008 1:59:46 PM PDT><INFO : backingbeans.AdvanceSearchProcessBean: ENTER loadDetailVotes>
      <Jun 11, 2008 1:59:46 PM PDT><INFO : backingbeans.AdvanceSearchProcessBean: EXIT loadDetailVotes>
      <Jun 11, 2008 1:59:46 PM PDT><after - INVOKE_APPLICATION 5>
      <Jun 11, 2008 1:59:46 PM PDT><before - RENDER_RESPONSE 6>
      <Jun 11, 2008 1:59:46 PM PDT><before - INVOKE_APPLICATION 5>
      <Jun 11, 2008 1:59:47 PM PDT><Done with Request!>
      <Jun 11, 2008 1:59:47 PM PDT><after - RENDER_RESPONSE 6>


      I am not really sure what might be the problem. I welcome and appreciate if someone can provide me with a hint on what might be the problem.

      Thanks.