struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Reumann" <>
Subject Some extra eyes to see where I'm screwing this code up...(form with Map property where keys-String, values-String[])
Date Mon, 24 Apr 2006 18:44:27 GMT
Thanks for any help...

Here's what the html page output looks like:

Product Roles




Backing this output is an ActionForm with the property:

HashMap productRolesMap;
//there is also a Map with this same name put into
//request scope

The ActionForm map has the keys set to the "productId" (number as a String)
and the value is a String[]. When the form submits I just want to
have the form's productRolesMap set with the String[] of the
selected roles. (Since these aren't boolean properties, all I need
is the values of the selected items).

Below is the code I was trying to use and it's working fine for
displaying the intial set of information (correct items are checked
and unchecked). The problem is when it submits, the String[] arrays in
the Map are not being updated at all.

The setter for the productRolesMap is called, but apparently the new
values selected are not being reflected in this Map.

The code I'm working with:

<c:forEach var="productMapItem" items="${productRolesMap}" varStatus="pStatus">
    <div style="padding-left:15px;">
        <c:forEach var="role" items="${productMapItem.value}">
            <html:multibox name="authenticateForm"

A snippet of the resulting html looks like:

<input type="checkbox" name="productRolesMap.2" value="INTERNALAUTHOR">

<input type="checkbox" name="productRolesMap.2" value="EXTERNALAUTHOR"

I'm sure it's something stupid that I'm doing wrong. (Isn't it always:)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message