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



      with the following code snippet:


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



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



      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")) );





      Am I missing something?