struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From G√ľnther Wieser ...@exa-online.de>
Subject problem with checkbox values and map backed properties
Date Fri, 29 Apr 2005 17:28:00 GMT
hi,

i have the following problem with map backed properties:

i created a form bean with a map called inCampaignMap, and the getter and
setters being "boolean getInCampaign(String key)" and "setInCampaign(String
key, boolean value)". internally, of course, the map value entries are of
type Boolean.

in my JSP i have the following code:
<html:checkbox property="inCampaign(${campaign.id})" />
where ${campaign.id} indicates the key for the map.

this works fine if the checkbox is checked. in this case i can see that the
setInCampaign() method is being called and that i get "true" for the value.

if the checkbox is unchecked, the value is NOT set.

strange enough, i also can see from the html code that's generate that
"value="on"" is always set, no matter if the checkbox is checked or not.

any ideas?

thanks in advance, kr,
guenther


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message