1 2 Previous Next 20 Replies Latest reply on Oct 3, 2007 7:35 PM by Pete Muir

    seam s:link fetchs list multiple times. big error !

    Luis Daniel Rangel Tovar Newbie

      s:link fetchs list multiple times, here's what happens, this is .xhtml fragment:

      <h:dataTable id="users" value="#{selectEmployee.resultList}" var="employee">
       <h:column> ... simple columns: employee.name, employee.phone, etc ... </h:column>
       <h:column>
       <s:link propagation="none" view="/register/register-employee.xhtml" >
       <f:param name="employeeId" value="#{employee.id}" />
       </s:link>
       <s:link propagation="none" view="/register/edit-calendar.xhtml" >
       <f:param name="employeeId" value="#{employee.id}" />
       </s:link>
       // some other links
       </h:column>
      </h:dataTable>


      ... and the Bean code looks like this:

      (I'm not extending EntityQuery because I needed lots of custom filters, for wich EntityQuery was not smart enough, like multiple EL bindings, or no binding at all, but thats a different matter)

      public List<Employee> getResultList() {
       // some initialization
       log.debug("fetchin' page from " + pageBegin + " to " + pageEnd ) ;
       return listEmployees.subList( pageBegin , pageEnd ) ;
      }


      ... the thing is, in logs, there is a print of debug when list is being fetched, then, lets say, if list has n results, and my page has m links per row, then there are n*m links, well, there are n*m fetchs. That sucks. If I change s:link for a href="something.seam?myParams" everything works fine, that however would be a bad anti-pattern sad sorry solution. I'm guessing the most common thing in the world would be to use links per row, so having multiple fetchs would be a bug/error/something-bad ...

      I'm using SEAM 1.2.1GA, jBoss-4.2.0.GA, ajax4jsf1.1.1Snapshot, richfaces-3.0.1-SNAPSHOT, jdk1.6.0_02

      Any ideas what is going on? Should this be posted as a bug on jira? Should I sit down and cry like a baby?

        1 2 Previous Next