Skip to site navigation (Press enter)

Re: Checkboxlist - bind to List

Laurie Harper 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]

  • Previous message
  • View by thread
  • View by date
  • Next message
  • Checkboxlist - bind to List<Object> Moacir Cardoso
    • Re: Checkboxlist - bind to List<Object> Laurie Harper

Reply via email to

The Mail Archive
  • The Mail Archive home
  • user - all messages
  • user - about the list
  • Expand
  • Previous message
  • Next message
user
  • The Mail Archive home
  • Add your mailing list
  • FAQ
  • Support
  • Privacy
  • fbn8ak$vt8$1@sea.gmane.org