3 Replies Latest reply on Jul 27, 2008 1:40 PM by Pete Muir

    c:for calls seam el method for each iteration

    Chad Skinner Newbie

      I am having an issue understanding the way data is processed in JSF using a method executed by the SEAM EL parser. I know this is not an issue with seam or its parser, but with my understanding of JSF and facelets and was wondering if anyone has seen this before and can help me resolve it.


      What I have is a method that I am calling from a Facelets Component. This component is used to load an agenda view of calendar events based on information provided by the page author. The problem is that the method on my bean is being called for every iteration of the loop rather than simply iterating the items returned by the initial call. The following is the Facelets code that displays the information:


      <c:set var="calendarAgenda" value="#{calendarManager.findAgendaItemsByItems(startDate, tps:stringToInteger(numEntries), null, tags)}" />
      <c:set var="agendaKeys" value="#{tps:retrieveMapKeys(calendarAgenda)}" />
      <table>
        <c:forEach var="agendaKey" items="${agendaKeys}">
           <!-- Header Outputs here
          <c:set var="agendaEntries" value="#{tps:retrieveMapValues(calendarAgenda, agendaKey)}" />
          <c:forEach var="agendaEntry" items="${agendaEntries}" varStatus="status">
            <!-- Day Data Outputs Here -->
          </c:forEach>
        </c:forEach>
      </table>
      



      I was under the impression that by calling c:set the values were returned and that the loop would simply iterate the results, but instead I end up with approximately 100 calls to this method. Has anyone seen this before and do you have any suggestions as to what I can do to fix it as I need to increase the performance?