This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes select all in list box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "select all in list box" Watch "select all in list box" New topic

select all in list box

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
I have a struts 2 list box, want to create button or link for "select all items" for user to click and select all the items in the list box. How to do that ? any example ?
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
I guess you'll have to do this with javascript. See this example.
First, make sure you give your listbox an id attribute;

Then, you can invoke this function when the user clicks on the button
GeeCON Prague 2014
subject: select all in list box