You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jones, Marty B." <ma...@dailyaccess.com> on 2003/08/05 14:04:24 UTC
Html tag question
I have an array of Project objects that are stored within a ActionForm class
(say ShowFileDiffsForm).
I have a getter and setter on the ShowFileDiffsForm:
Project[] getProjects()
void setProjects(Project[] projects)
The Project object itself has the attributes:
int id;
String name
My question is how can I build a logic:iterate tag to iterate over the array
of project objects.?
Here is what I have so far
<logic:iterate id="element" name="showFileDiffsForm" property="projects"
indexId="index">
<li><em><bean:write name="element.name"/></em> [<bean:write
name="index"/>]</li>
</logic:iterate>
The one thing that I don't know how to do is to write the name and the
project id out for each iteration. ]
Can anyone shed any light on this?
________________________
Marty B. Jones
Senior Software Engineer
DailyAccess.Com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Html tag question
Posted by Nagendra Kumar O V S <na...@ikigo.com>.
<logic:iterate id="element" name="showFileDiffsForm" property="projects">
<li><em><bean:write name="element" property="name"/></em>
[<bean:write name="element" property="id"/>]</li>
</logic:iterate>
-- nagi
-------Original Message-------
From: Struts Users Mailing List
Date: Tuesday, August 05, 2003 05:34:45 PM
To: struts-user@jakarta.apache.org
Subject: Html tag question
I have an array of Project objects that are stored within a ActionForm class
(say ShowFileDiffsForm).
I have a getter and setter on the ShowFileDiffsForm:
Project[] getProjects()
void setProjects(Project[] projects)
The Project object itself has the attributes:
int id;
String name
My question is how can I build a logic:iterate tag to iterate over the array
of project objects.?
Here is what I have so far
<logic:iterate id="element" name="showFileDiffsForm" property="projects"
indexId="index">
<li><em><bean:write name="element.name"/></em> [<bean:write
name="index"/>]</li>
</logic:iterate>
The one thing that I don't know how to do is to write the name and the
project id out for each iteration. ]
Can anyone shed any light on this?
________________________
Marty B. Jones
Senior Software Engineer
DailyAccess.Com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
.