File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes jstl mapped properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "jstl mapped properties" Watch "jstl mapped properties" New topic

jstl mapped properties

Lee Wright

Joined: Nov 29, 2004
Posts: 11
I'm hitting the following problem using mapped properties...

I have a map of objects where the key is a Product object and the value is a List of Product objects.
I loop through the objects and want to be able to select one or more items using a checkbox.

The looping works fine but the isSelected property never gets set:

<c:forEach varStatus="i" var="lineCode" items="${requestForm.linecodeItems}">
<th> </th>
<th class="grey"><html-el:link action="/viewLinecode?selectedProduct=${lineCode.key.ID}"><cut value="${lineCode.key.productCode}"></cut></html-el:link></th>
<th scope="row"> </th>
<th scope="row"> </th>
<th scope="row"> </th>
<c:forEach items="${lineCode.value}" var="product">
<th class="grey" scope="row"><html:checkbox name="product" property="selected" value="true" indexed="true"/></th>
<th nowrap="nowrap" class="grey" scope="row"><html-el:link action="/viewLinecode?selectedProduct=${lineCode.key.ID}"><cut value="${lineCode.key.productCode}"/></html-el:link></th>
<th nowrap="nowrap" class="grey" scope="row"><html-el:link action="/viewLinecode?selectedProduct=${product.ID}"><cut value="${product.productCode}"/></html-el:link></th>
<td nowrap="nowrap" class="grey" scope="row"><cut value="${product.description}"/></td>
<td nowrap="nowrap" class="grey" scope="row"><cut value="${product.size}"/></td>

Can anybody help???

Thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62272

Since this has more to do with the Struts tag than JSTL, moving to the Web App Frameworks forum.
[ December 11, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: jstl mapped properties