2 Replies Latest reply on Mar 25, 2010 7:17 AM by Paulo Pinto

    <c:forEach> on the CDK Templates generates invalid code

    Paulo Pinto Novice

      Hi,

       

      with the following code snippet:

       

      {code:xml}
      <div id="#{clientId}" title="#{value}" x:passThruWithExclusions="value,name,type,id">
              <c:forEach var="element" items="#{itemsList}">
                <a href="http://#{element}">#{element}</a>
              </c:forEach>
          </div>
      {code}

       

       

      I was expecting to be able to traverse the list, but the code that gets generated expects a from-to-step loop!

       

      {code}

      for (
          variables.setVariable("element", $from);
          Integer.getInteger(variables.getVariable("element").toString()).intValue() < Integer.getInteger($to).toString()).intValue();
          variables.addValueToVariable("element", new Integer(1) )
          ) {
      writer.startElement("a", component);
                  getUtils().writeAttribute(writer, "href", "http://" + convertToString(variables.getVariable("element")) );
                 
      writer.writeText(convertToString(variables.getVariable("element")),null);

       

      writer.endElement("a");
      }

      {code}

       

      Am I missing something?