[richfaces-issues] [JBoss JIRA] Created: (RF-8051) c:foreach not working in template files

Marco Huber (JIRA) jira-events at lists.jboss.org
Wed Oct 28 11:00:05 EDT 2009


c:foreach not working in template files
---------------------------------------

                 Key: RF-8051
                 URL: https://jira.jboss.org/jira/browse/RF-8051
             Project: RichFaces
          Issue Type: Bug
          Components: CDK
    Affects Versions: 3.3.2.SR1
         Environment: Java 6, Windows XP Pro SP2
            Reporter: Marco Huber


Using c:foreach in a template file (.jspx) results in strange errors.

1st: The generated class missed a semicolon at the end of the for loop.

After investigation this error in the source, I found out that the velocity template was incorrect (A brake was too much). 

2nd: The wrong template was used in the ForEachTemplateElement.java.

if (this.strItems != null) {
	indexForCollection++;
	templateName = getTemplate1Name();//"FORElement_1.vm");
	context.put("items", this.strItems);
	context.put("index", new Integer(indexForCollection));
} else {
	templateName = getTemplate2Name();//"FORElement_2.vm");
	context.put("from", this.strFrom);
	context.put("to", this.strTo);
}

Despite the comment in the source the template file names are switch in the getTemplateXXXName methods. After fixing this all work correclty.

I attachted the corrected files, hoping they could be put in the next release.

Regards,
Marco

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list