Re: Checkboxlist - bind to List

Wed, 05 Sep 2007 15:05:44 -0700

Moacir Cardoso wrote:
Hello!,
I´m trying to bind some checkbox values to one parameterized List. Lets say List<Car>.
Is it possible?

in Jsp:
<s:checkboxlist name="myList.carId" list="#{'1':'Car1','2':'Car2','3':'Car3'}"></s:checkboxlist>

in Action:

private List<Car> myList;
... gets and sets.

If you already have a list in your action, you don't need/want to hardcode one in the tag. Try something like:

  <s:checkboxlist name='myListSelected' list='myList'
    listKey='carId' listValue='carName'/>

See the tag docs for more options:

  http://struts.apache.org/2.x/docs/checkboxlist.html

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to