2 Replies Latest reply on Mar 5, 2009 9:19 AM by Fan Shao

    Why do my getters are not called?

    Fan Shao Newbie

      Hi,

      I am writting a page, which contains a tree. When the user clicks on the tree, some content are displayed in another area in the same page.

       <h:panelGroup styleClass="tree">
       <rich:tree value="#{hReportItems.tree}" var="data" switchType="client"
       adviseNodeOpened="#{hTaskNav.isNodeOpened}">
       <rich:treeNode>
       <a4j:commandLink immediate="true" action="#{hReportItems.doShowReport}" reRender="ContentsA">
       <f:setPropertyActionListener target="#{hReportItems.selectedReportItemId}" value="#{data.id}"/>
       <f:setPropertyActionListener target="#{hReportItems.rid}" value="#{data.id}"/>
       <h:outputText value="#{data.name} [#{data.id}]"/>
       </a4j:commandLink>
       </rich:treeNode>
       </rich:tree>
       </h:panelGroup>
      
      



      Another area in the same page I wrote:
      <a4j:outputPanel id="ContentsA" ajaxRendered="true">
      <span style="color:red">rid: <h:outputText value="#{hReportItem.rid}"/></span><br/>
      </a4j:outputPanel>
      




      But the latter is not rendered when the tree is clicked, so it leaves a blank in that area.

      I debugged and put a PhaseListener in the life cycle, and I can clearly see the getters are not called, thougt the setter are called and the right values are set to the bean.

      Could anyone help on this?

      Thanks a lot.

        • 1. Re: Why do my getters are not called?
          Fan Shao Newbie

          I put a logger in both the setters and the getters of that particular property, and this is what I've got. I expect the getters to be called in the last phase, but it was not.

          <2009-03-05 13:54:36,554> DEBUG ui.listeners.BeanPhaseListener - Phase RESTORE_VIEW 1 started
          <2009-03-05 13:54:36,570> DEBUG ui.listeners.BeanPhaseListener - Phase RESTORE_VIEW 1 finished
          <2009-03-05 13:54:36,570> DEBUG ui.listeners.BeanPhaseListener - Phase APPLY_REQUEST_VALUES 2 started
          <2009-03-05 13:54:36,570> DEBUG ui.handlers.reportitems.ReportItemHandler - Setter of 'selectedReportItemId' called
          <2009-03-05 13:54:36,570> DEBUG ui.handlers.reportitems.ReportItemHandler - Setter of 'id' called
          <2009-03-05 13:54:36,570> INFO ui.handlers.reportitems.ReportItemHandler - Selected report is 3
          <2009-03-05 13:54:36,585> INFO ui.handlers.reportitems.ReportItemHandler - Report arguments reloaded, rendering the page
          <2009-03-05 13:54:36,585> DEBUG ui.listeners.BeanPhaseListener - Phase APPLY_REQUEST_VALUES 2 finished
          <2009-03-05 13:54:36,585> DEBUG ui.listeners.BeanPhaseListener - Phase RENDER_RESPONSE 6 started
          <2009-03-05 13:54:36,617> DEBUG ui.listeners.BeanPhaseListener - Phase RENDER_RESPONSE 6 finished
          <2009-03-05 13:55:38,586> DEBUG ui.listeners.BeanPhaseListener - Phase RESTORE_VIEW 1 started
          <2009-03-05 13:55:38,586> DEBUG ui.listeners.BeanPhaseListener - Phase RESTORE_VIEW 1 finished

          • 2. Re: Why do my getters are not called?
            Fan Shao Newbie

            Solved! That's because the name of the bean was wrongl spelled. Interestingly, I don't get any exception or warning when this happens.