3 Replies Latest reply on Dec 13, 2006 12:51 AM by jazir1979

    Iterating over @Factory list - c:forEach vs ui:repeat

    jazir1979

      Hi all,

      I'm using facelets and had been building up a menu of modules that a user has access to using a list outjected by a Seam @Factory method:

      <c:forEach items="#{moduleList}" var="module">
       <t:navigationMenuItem ............
       </t:navigationMenuItem>
      </c:forEach>
      


      I attempted to change this to use ui:repeat with value="#{moduleList}", but now my @Factory method is never called, it's just as if the list is empty. I am including the ui namespace in my xhtml header.

      Does anybody have an idea why this would happen?

      cheers,
      Daniel.


        • 1. Re: Iterating over @Factory list - c:forEach vs ui:repeat
          gavin.king

          It should work.

          • 2. Re: Iterating over @Factory list - c:forEach vs ui:repeat
            jazir1979

             

            "gavin.king@jboss.com" wrote:
            It should work.


            It definitely isn't working. I've just come back to this, because it's really becoming an issue (I need ui:repeat, not c:foreach).

            I'm trying to work out why the UIRepeat component with value "#{moduleList}" is not attempting to call into my factory method, and I'm just after some hints on where to look...

            Should this go through SeamVariableResolver? I see no logging like "resolving name: moduleList" anywhere.

            Or is it SeamELResolver (which I'm not sure is configured, as it's commented out in Seam's faces-config.xml)? Am I looking in the right place at all - exactly how does Seam tie together the JSF ValueBinding resolution with Seam Component lookups?

            I'm happy to go debugging this myself, with some pointers.. :)

            cheers,
            Daniel.


            • 3. Re: Iterating over @Factory list - c:forEach vs ui:repeat
              jazir1979

              Nevermind....... it's happening because TOMAHAWK panelNavigation2 only renders direct children that are menu items, which means my ui:repeat isn't even being rendered.

              Many apologies... *runs off to finally remove tomahawk from my codebase, after ignoring your warnings*