You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Nidel <mi...@lmco.com> on 2005/03/04 19:55:53 UTC

map-backed forms with multibox/multiselect lists?

I'm trying to build a form element that combines the features of a map-backed
property with a multibox (and the same for a multiple-selection list). I've made
multiboxes work fine without the map-backed element, but I can't seem to get
this to work.

I've tried various method signatures in my form bean, but to no avail. For
example, for a field called "foo" I have tried the following:

public void setFoo(String key, Object val)
{
...
}


or


public void setFoo(String key, String[] val)
{
...
}



I'm using a set of checkboxes on the JSP which should result in a list of the
values of whichever boxes are selected. I can think of a number of javascript
workarounds, as well as workarounds in my Action that go directly to the request
parameters... but all of those are kludges and it seems like there should be a
way to have multiple checkboxes that all reference a map-backed form property.


Any thoughts?

thanks a bunch,

Mike Nidel


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: map-backed forms with multibox/multiselect lists?

Posted by Dakota Jack <da...@gmail.com>.
public void setFoos(String [] foos)


On Fri, 4 Mar 2005 18:55:53 +0000 (UTC), Mike Nidel <mi...@lmco.com> wrote:
> I'm trying to build a form element that combines the features of a map-backed
> property with a multibox (and the same for a multiple-selection list). I've made
> multiboxes work fine without the map-backed element, but I can't seem to get
> this to work.
> 
> I've tried various method signatures in my form bean, but to no avail. For
> example, for a field called "foo" I have tried the following:
> 
> public void setFoo(String key, Object val)
> {
> ...
> }
> 
> or
> 
> public void setFoo(String key, String[] val)
> {
> ...
> }
> 
> I'm using a set of checkboxes on the JSP which should result in a list of the
> values of whichever boxes are selected. I can think of a number of javascript
> workarounds, as well as workarounds in my Action that go directly to the request
> parameters... but all of those are kludges and it seems like there should be a
> way to have multiple checkboxes that all reference a map-backed form property.
> 
> Any thoughts?
> 
> thanks a bunch,
> 
> Mike Nidel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org