Hi all,
I am trying to print out a list of objects using iterator tag, but not
getting the value I want. Is there any doc on Iterator and Property tags
(ww-2) available?
Here is what I'm trying to do:
I have a list of departments (department object has id and name properties)
retrived from db, such as:
List deptList = getDeptListFromDB();
..... geter/setter not shown ...
and in a jsp I do this:
<ww:if test="deptList != null">
<p>
<table width="90%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="24" height="17" valign="top" bgcolor="#FFFFCC"><p
class="kecil" align="left"> ID</p></td>
<td valign="top" bgcolor="#FFFFCC"><p class="kecil"
align="left"> Name</p></td>
</tr>
<ww:iterator value="departmentList">
<tr>
<td width="24" height="17" valign="top" bgcolor="#FFFFCC"><p
class="kecil" align="left"> <ww:property value="key" /></p></td>
<td valign="top" bgcolor="#FFFFCC"><p class="kecil"
align="left"> <ww:property value="value" /></p></td>
</tr>
</ww:iterator>
</table>
</ww:if>
Now, the iterator tag print the corect number of elements, but null for key
and value. I know I did something wrong here using a map instead. I simply
don't know how to printout the list' content properties (in this case id and
name of a department object). I guess I could try to convert the list into a
map and use the above code, that may work. However, if there is another
simpler way, I would love to know.
Thanks,
/bernard
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork